Changed NewPlugin function to Command that returns []utils.Command directly

This commit is contained in:
Kelvin Clement Mwinuka
2024-01-16 12:16:30 +08:00
parent d2e602e97a
commit 4a7753a46c

View File

@@ -487,10 +487,8 @@ func handleSave(ctx context.Context, cmd []string, server utils.Server, conn *ne
return []byte(utils.OK_RESPONSE), nil
}
func NewModule() Plugin {
ACLPlugin := Plugin{
name: "ACLCommands",
commands: []utils.Command{
func Commands() []utils.Command {
return []utils.Command{
{
Command: "auth",
Categories: []string{utils.ConnectionCategory, utils.SlowCategory},
@@ -605,8 +603,5 @@ When 'REPLACED' is passed, users from config file who share a username with user
},
},
},
},
description: "Internal plugin to handle ACL commands",
}
return ACLPlugin
}