Renamed NewPlugin function to a Command that returns []utils.Command directly

This commit is contained in:
Kelvin Clement Mwinuka
2024-01-17 12:21:40 +08:00
parent 2113a5bc31
commit c849b3c44e

View File

@@ -589,10 +589,8 @@ func handleHDEL(ctx context.Context, cmd []string, server utils.Server, conn *ne
return []byte(fmt.Sprintf(":%d\r\n\r\n", count)), nil
}
func NewModule() Plugin {
SetModule := Plugin{
name: "HashCommands",
commands: []utils.Command{
func Commands() []utils.Command {
return []utils.Command{
{
Command: "hset",
Categories: []string{utils.HashCategory, utils.WriteCategory, utils.FastCategory},
@@ -766,9 +764,5 @@ Return the string length of the values stored at the specified fields. 0 if the
},
HandlerFunc: handleHDEL,
},
},
description: "Handle HASH commands",
}
return SetModule
}