mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
31 lines
764 B
Go
31 lines
764 B
Go
package common
|
|
|
|
const (
|
|
CommandStart = ""
|
|
CommandValidate = "validate"
|
|
CommandListConfigs = "ls-config"
|
|
CommandListRoutes = "ls-routes"
|
|
CommandListIcons = "ls-icons"
|
|
CommandReload = "reload"
|
|
CommandDebugListEntries = "debug-ls-entries"
|
|
CommandDebugListProviders = "debug-ls-providers"
|
|
CommandDebugListMTrace = "debug-ls-mtrace"
|
|
)
|
|
|
|
type MainServerCommandValidator struct{}
|
|
|
|
func (v MainServerCommandValidator) IsCommandValid(cmd string) bool {
|
|
switch cmd {
|
|
case CommandStart,
|
|
CommandValidate,
|
|
CommandListConfigs,
|
|
CommandListRoutes,
|
|
CommandListIcons,
|
|
CommandReload,
|
|
CommandDebugListEntries,
|
|
CommandDebugListProviders,
|
|
CommandDebugListMTrace:
|
|
return true
|
|
}
|
|
return false
|
|
}
|