command

package
v0.0.0-...-347df5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RESTART_SERVICE_COMMAND  = "service_restart"
	LOAD_CONFIG_COMMAND      = "load_config"
	SET_CONFIG_VALUE_COMMAND = "set_config"
)

Variables

View Source
var (
	InvalidParamError = errors.New("invalid param in payload")
)

Functions

func NewCommandListener

func NewCommandListener(serviceName string, handler nats.EventHandler) *commandListener

Types

type CommandListener

type CommandListener interface {
	ListenToCommands()
	SetServiceRestartCb(cb func())
	SetConfigLoadCb(cb func(string))
	SetConfigValueCb(cb func(string, string))
}

type LoadConfigCommand

type LoadConfigCommand protocol.RequestMessage

func NewLoadConfigCommand

func NewLoadConfigCommand(msgId uint32, param string) *LoadConfigCommand

func (*LoadConfigCommand) ReadParam

func (command *LoadConfigCommand) ReadParam() (string, error)

type ServiceRestartCommand

type ServiceRestartCommand protocol.RequestMessage

func NewServiceRestartCommand

func NewServiceRestartCommand(msgId uint32) *ServiceRestartCommand

type SetConfigValueCommand

type SetConfigValueCommand protocol.RequestMessage

func NewSetConfigValueCommand

func NewSetConfigValueCommand(msgId uint32, config []string) *SetConfigValueCommand

func (*SetConfigValueCommand) ReadConfig

func (command *SetConfigValueCommand) ReadConfig() ([]string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL