Documentation
¶
Index ¶
- func GetModOptVal(opts map[string]string, key string) string
- func InitializeDefaultModules() error
- func ModuleInstances() <-chan *ModuleInstance
- func ModuleTypes() <-chan *ModuleType
- func RegisterModule(name string, ignoreFailOnInit bool, initFunc Init, ...) int32
- func StartDefaultModules() error
- func StartModule(modInstId int32) error
- type Init
- type Module
- type ModuleConfig
- type ModuleInstance
- type ModuleType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeDefaultModules ¶
func InitializeDefaultModules() error
func ModuleInstances ¶
func ModuleInstances() <-chan *ModuleInstance
func ModuleTypes ¶
func ModuleTypes() <-chan *ModuleType
func RegisterModule ¶
func RegisterModule( name string, ignoreFailOnInit bool, initFunc Init, defaultConfigs []*ModuleConfig) int32
func StartDefaultModules ¶
func StartDefaultModules() error
func StartModule ¶
Types ¶
type Init ¶
type Init func(id int32, config *ModuleConfig) (Module, error)
Init initializes the module.
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.
type ModuleConfig ¶
type ModuleInstance ¶
type ModuleInstance struct {
Id int32 `json:"id"`
Type *ModuleType `json:"-"`
TypeId int32 `json:"typeId"`
Inst Module `json:"-"`
Name string `json:"name"`
Config *ModuleConfig `json:"config,omitempty"`
Description string `json:"description"`
IsStarted bool `json:"started"`
}
func GetModuleInstance ¶
func GetModuleInstance(modInstId int32) (*ModuleInstance, error)
func InitializeModule ¶
func InitializeModule( modTypeId int32, modConfig *ModuleConfig) (*ModuleInstance, error)
type ModuleType ¶
type ModuleType struct {
Id int32 `json:"id"`
Name string `json:"name"`
IgnoreFailOnInit bool `json:"-"`
InitFunc Init `json:"-"`
DefaultConfigs []*ModuleConfig `json:"defaultConfigs"`
}
Click to show internal directories.
Click to hide internal directories.