Documentation ¶
Index ¶
- func GetModOptVal(opts map[string]string, key string) string
- func InitializeDefaultModules() error
- func Instances() <-chan *Instance
- func RegisterModule(name string, ignoreFailOnInit bool, initFunc Init, defaultConfigs []*Config) int32
- func StartDefaultModules() error
- func StartModule(modInstID int32) error
- func Types() <-chan *Type
- type Config
- type Init
- type Instance
- type Module
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModOptVal ¶
GetModOptVal gets a module's option value.
func InitializeDefaultModules ¶
func InitializeDefaultModules() error
InitializeDefaultModules initializes the default modules.
func Instances ¶ added in v0.2.1
func Instances() <-chan *Instance
Instances returns a channel that receives the instantiated module instances.
func RegisterModule ¶
func RegisterModule( name string, ignoreFailOnInit bool, initFunc Init, defaultConfigs []*Config) int32
RegisterModule registers a module.
func StartDefaultModules ¶
func StartDefaultModules() error
StartDefaultModules starts the default modules.
func StartModule ¶
StartModule starts the module with the provided instance ID.
Types ¶
type Config ¶ added in v0.2.1
type Config struct { Address string `json:"address"` Config gofig.Config `json:"config,omitempty"` }
Config is a struct used to configure a module.
type Instance ¶ added in v0.2.1
type Instance struct { ID int32 `json:"id"` Type *Type `json:"-"` TypeID int32 `json:"typeId"` Inst Module `json:"-"` Name string `json:"name"` Config *Config `json:"config,omitempty"` Description string `json:"description"` IsStarted bool `json:"started"` }
Instance is a struct that describes a module instance
func GetModuleInstance ¶
GetModuleInstance gets the module instance with the provided instance ID.
type Module ¶
type Module interface { // Id gets the module's unique identifier. ID() int32 // Start starts the module. Start() error // Stop signals the module to stop. Stop() error // Name is the name of the module. Name() string // Address is the network address at which the module is available. Address() string // Description is a free-form field ot add descriptive information about // the module instance. Description() string }
Module is the interface to which types adhere in order to participate as daemon modules.
Click to show internal directories.
Click to hide internal directories.