Documentation ¶
Index ¶
Constants ¶
View Source
const ( ModeNone = iota ModeStarting ModeStarted ModeStopping ModeStopped )
Variables ¶
View Source
var AllModes = []ExecutableMode{}
Functions ¶
func RunConfiguredMode ¶
Runs the mode that is activated within the specified config instance, returning false if the mode stopped due to a kill or interrupt and true when the mode stopped due to an error.
Types ¶
type ClientMode ¶
type ClientMode struct {
// contains filtered or unexported fields
}
func NewClientMode ¶
func NewClientMode() *ClientMode
func (*ClientMode) IsConfigAcceptable ¶
func (self *ClientMode) IsConfigAcceptable(config *util.Config) bool
func (*ClientMode) Name ¶
func (self *ClientMode) Name() string
func (*ClientMode) Status ¶
func (self *ClientMode) Status() *util.AtomicInt32
func (*ClientMode) Stop ¶
func (self *ClientMode) Stop()
type ExecutableMode ¶
type ExecutableMode interface { util.ConfigVerifier // Returns the name of the mode. Name() string // Returns the status of the mode. Status() *util.AtomicInt32 // Start the mode and returns after the mode has been started. Start(config *util.Config) error // Stops the mode. Stop() }
Defines an interface for implementations of a run mode of this util.
func GetConfiguredMode ¶
func GetConfiguredMode(config *util.Config) ExecutableMode
Returns the mode that is activated within the specified config instance.
func RegisterMode ¶
func RegisterMode(mode ExecutableMode) ExecutableMode
Registers a run mode implementation.
type ExecutableModeListener ¶
type ExecutableModeListener func(mode ExecutableMode, nextStatus int32, config *util.Config)
Defines a callback that is notified when a mode is before start, started or stopped.
func RegisterModeListener ¶
func RegisterModeListener(listener ExecutableModeListener) ExecutableModeListener
Registers a mode listener.
type ServerMode ¶
type ServerMode struct {
// contains filtered or unexported fields
}
func NewServerMode ¶
func NewServerMode() *ServerMode
func (*ServerMode) IsConfigAcceptable ¶
func (self *ServerMode) IsConfigAcceptable(config *util.Config) bool
func (*ServerMode) Name ¶
func (self *ServerMode) Name() string
func (*ServerMode) Status ¶
func (self *ServerMode) Status() *util.AtomicInt32
func (*ServerMode) Stop ¶
func (self *ServerMode) Stop()
Click to show internal directories.
Click to hide internal directories.