Renamed *AccessKey type to better represent the response on *KeyExtractionFunc types

This commit is contained in:
Kelvin Clement Mwinuka
2024-04-28 07:34:34 +08:00
parent 972cbe0a4f
commit c241cc07b1
13 changed files with 316 additions and 314 deletions

View File

@@ -197,8 +197,8 @@ func Commands() []internal.Command {
Categories: []string{constants.AdminCategory, constants.SlowCategory},
Description: "Get a list of all the commands in available on the echovault with categories and descriptions",
Sync: false,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),
@@ -212,8 +212,8 @@ func Commands() []internal.Command {
Categories: []string{},
Description: "Commands pertaining to echovault commands",
Sync: false,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),
@@ -226,8 +226,8 @@ func Commands() []internal.Command {
Categories: []string{constants.SlowCategory, constants.ConnectionCategory},
Description: "Get command documentation",
Sync: false,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),
@@ -241,8 +241,8 @@ func Commands() []internal.Command {
Categories: []string{constants.SlowCategory},
Description: "Get the dumber of commands in the echovault",
Sync: false,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),
@@ -257,8 +257,8 @@ func Commands() []internal.Command {
Description: `(COMMAND LIST [FILTERBY <ACLCAT category | PATTERN pattern | MODULE module>]) Get the list of command names.
Allows for filtering by ACL category or glob pattern.`,
Sync: false,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),
@@ -274,8 +274,8 @@ Allows for filtering by ACL category or glob pattern.`,
Categories: []string{constants.AdminCategory, constants.SlowCategory, constants.DangerousCategory},
Description: "(SAVE) Trigger a snapshot save",
Sync: true,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),
@@ -294,8 +294,8 @@ Allows for filtering by ACL category or glob pattern.`,
Categories: []string{constants.AdminCategory, constants.FastCategory, constants.DangerousCategory},
Description: "(LASTSAVE) Get unix timestamp for the latest snapshot in milliseconds.",
Sync: false,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),
@@ -315,8 +315,8 @@ Allows for filtering by ACL category or glob pattern.`,
Categories: []string{constants.AdminCategory, constants.SlowCategory, constants.DangerousCategory},
Description: "(REWRITEAOF) Trigger re-writing of append process",
Sync: false,
KeyExtractionFunc: func(cmd []string) (internal.AccessKeys, error) {
return internal.AccessKeys{
KeyExtractionFunc: func(cmd []string) (internal.KeyExtractionFuncResult, error) {
return internal.KeyExtractionFuncResult{
Channels: make([]string, 0),
ReadKeys: make([]string, 0),
WriteKeys: make([]string, 0),