initialize.go 1.3 KB

12345678910111213141516171819202122232425
  1. package usecases
  2. import (
  3. "git.riomhaire.com/gremlin/jrpcserver/model"
  4. "git.riomhaire.com/gremlin/jrpcserver/usecases/defaultcommand"
  5. )
  6. var Commands []model.JRPCCommand
  7. func InitializeCommands() []model.JRPCCommand {
  8. commands := make([]model.JRPCCommand, 0)
  9. commands = append(commands, model.JRPCCommand{"test.ping", defaultcommand.PingCommand, false})
  10. commands = append(commands, model.JRPCCommand{"test.pong", defaultcommand.PongCommand, false})
  11. commands = append(commands, model.JRPCCommand{"test.echo", defaultcommand.EchoCommand, true})
  12. commands = append(commands, model.JRPCCommand{"system.commands", defaultcommand.ListCommandsCommand, false})
  13. commands = append(commands, model.JRPCCommand{"system.version.raw", defaultcommand.VersionCommand, true})
  14. commands = append(commands, model.JRPCCommand{"system.version", defaultcommand.VersionCommand, false})
  15. commands = append(commands, model.JRPCCommand{"system.info.raw", defaultcommand.InfoCommand, true})
  16. commands = append(commands, model.JRPCCommand{"system.info", defaultcommand.InfoCommand, false})
  17. commands = append(commands, model.JRPCCommand{"system.health.raw", defaultcommand.HealthCommand, true})
  18. commands = append(commands, model.JRPCCommand{"system.health", defaultcommand.HealthCommand, false})
  19. Commands = commands // needed for list
  20. return commands
  21. }