mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-04 23:52:42 +08:00
Added godoc comments for api_admin.go functions
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -16,12 +16,26 @@ package echovault
|
||||
|
||||
import "github.com/echovault/echovault/internal"
|
||||
|
||||
// CommandListOptions modifies the result from the COMMAND_LIST command.
|
||||
//
|
||||
// ACLCAT filters the results by the provided category. Has the highest priority.
|
||||
//
|
||||
// PATTERN filters the result that match the given glob pattern. Has the second-highest priority.
|
||||
//
|
||||
// MODULE filters the result by the provided module. Has the lowest priority.
|
||||
type CommandListOptions struct {
|
||||
ACLCAT string
|
||||
PATTERN string
|
||||
MODULE string
|
||||
}
|
||||
|
||||
// COMMAND_LIST returns the list of commands currently loaded in the EchoVault instance.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// `options` - CommandListOptions.
|
||||
//
|
||||
// Returns: a string slice of all the loaded commands. SubCommands are represented as "command|subcommand".
|
||||
func (server *EchoVault) COMMAND_LIST(options CommandListOptions) ([]string, error) {
|
||||
cmd := []string{"COMMAND", "LIST"}
|
||||
|
||||
@@ -42,6 +56,9 @@ func (server *EchoVault) COMMAND_LIST(options CommandListOptions) ([]string, err
|
||||
return internal.ParseStringArrayResponse(b)
|
||||
}
|
||||
|
||||
// COMMAND_COUNT returns the number of commands currently loaded in the EchoVault instance.
|
||||
//
|
||||
// Returns: integer representing the count of all available commands.
|
||||
func (server *EchoVault) COMMAND_COUNT() (int, error) {
|
||||
b, err := server.handleCommand(server.context, internal.EncodeCommand([]string{"COMMAND", "COUNT"}), nil, false)
|
||||
if err != nil {
|
||||
@@ -50,6 +67,7 @@ func (server *EchoVault) COMMAND_COUNT() (int, error) {
|
||||
return internal.ParseIntegerResponse(b)
|
||||
}
|
||||
|
||||
// SAVE triggers a new snapshot.
|
||||
func (server *EchoVault) SAVE() (string, error) {
|
||||
b, err := server.handleCommand(server.context, internal.EncodeCommand([]string{"SAVE"}), nil, false)
|
||||
if err != nil {
|
||||
@@ -58,6 +76,7 @@ func (server *EchoVault) SAVE() (string, error) {
|
||||
return internal.ParseStringResponse(b)
|
||||
}
|
||||
|
||||
// LASTSAVE returns the unix epoch milliseconds timestamp of the last save.
|
||||
func (server *EchoVault) LASTSAVE() (int, error) {
|
||||
b, err := server.handleCommand(server.context, internal.EncodeCommand([]string{"LASTSAVE"}), nil, false)
|
||||
if err != nil {
|
||||
@@ -66,6 +85,7 @@ func (server *EchoVault) LASTSAVE() (int, error) {
|
||||
return internal.ParseIntegerResponse(b)
|
||||
}
|
||||
|
||||
// REWRITEAOF triggers a compaction of the AOF file.
|
||||
func (server *EchoVault) REWRITEAOF() (string, error) {
|
||||
b, err := server.handleCommand(server.context, internal.EncodeCommand([]string{"REWRITEAOF"}), nil, false)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user