Documentation ¶
Overview ¶
Package cmd NOTES
Index ¶
- type Cmd
- func WithDeregister(sd serviced.Service) Cmd
- func WithDisableMasterSlave(sd serviced.Service) Cmd
- func WithDisableWriteAuthAccess(opt *options.DisableWriteOption) Cmd
- func WithEnableMasterSlave(sd serviced.Service) Cmd
- func WithEnableWriteAuthAccess(opt *options.DisableWriteOption) Cmd
- func WithGetDisableWriteAuthAccess(opt *options.DisableWriteOption) Cmd
- func WithLog() Cmd
- func WithQueryRuntimeSetting(settings interface{}) Cmd
- func WithRefreshCache(op client.Interface) Cmd
- func WithRegister(sd serviced.Service) Cmd
- func WithWrites(opt *options.DisableWriteOption) []Cmd
- type Command
- type Help
- type Parameter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd interface { // GetCommand get Command. GetCommand() *Command // Validate Cmd. Validate() error }
Cmd is an interface that represents a control tools command.
func WithDeregister ¶
WithDeregister init and returns the deregister command.
func WithDisableMasterSlave ¶
WithDisableMasterSlave init and returns the disabling master-slave command.
func WithDisableWriteAuthAccess ¶
func WithDisableWriteAuthAccess(opt *options.DisableWriteOption) Cmd
WithDisableWriteAuthAccess init and returns the disabling write auth access command, it blocks write operations on the authorization phase.
func WithEnableMasterSlave ¶
WithEnableMasterSlave init and returns the enabling master-slave command.
func WithEnableWriteAuthAccess ¶
func WithEnableWriteAuthAccess(opt *options.DisableWriteOption) Cmd
WithEnableWriteAuthAccess init and returns the enabling write command.
func WithGetDisableWriteAuthAccess ¶
func WithGetDisableWriteAuthAccess(opt *options.DisableWriteOption) Cmd
WithGetDisableWriteAuthAccess init and returns the getting disable write option command.
func WithQueryRuntimeSetting ¶
func WithQueryRuntimeSetting(settings interface{}) Cmd
WithQueryRuntimeSetting init and returns the query runtime setting command for sidecar.
func WithRefreshCache ¶
WithRefreshCache init and returns the refreshing cache command.
func WithRegister ¶
WithRegister init and returns the register command.
func WithWrites ¶
func WithWrites(opt *options.DisableWriteOption) []Cmd
WithWrites init and returns the disable/enable/get write operations commands that auth server needed.
type Command ¶
type Command struct { // Name of this command, used to call the http handler of the command. Name string // Usage of this command, used in helper to inform the user how to use the command. Usage string // Parameters List of all needed parameters of the command, children will inherit these parameters. Parameters []Parameter // FromURL defines whether to read the parameters from url or from body, parameters should <= 5 if read from url. FromURL bool // IsHidden defines whether to show this command to the caller. if is true, caller only call this command, but not // get this command from help info. IsHidden bool // Run the command handler function. Run func(kt *kit.Kit, params map[string]interface{}) (interface{}, error) // contains filtered or unexported fields }
Command is the control tools command definition.
type Help ¶
type Help struct { Usage string `json:"usage"` Example string `json:"example"` AvailableCommands map[string]string `json:"available_commands,omitempty"` Parameters map[string]string `json:"parameters,omitempty"` }
Help cmd help info.
type Parameter ¶
type Parameter struct { // Name of this parameter, used to pass to the command handler. Name string // Usage of this parameter, used in helper to inform the user how to use the parameter. Usage string // Default value of this parameter, this value is passed to the command handler if not set. Default interface{} // Value the **not nil pointer** with the value type of this parameter to decode param value into it. Value interface{} }
Parameter is the control tools command parameter definition.