Documentation ¶
Index ¶
- Constants
- func LoadEnabledModulesConfig(data []byte)
- type Module
- func (m Module) CheckEnabled() error
- func (m *Module) DependsOn(s ...string)
- func (m *Module) LoadAfter(s ...string)
- func (m *Module) LoadBefore(s ...string)
- func (m Module) NotLoadedError() ModuleNotLoadedError
- func (m *Module) Provides(s ...string)
- func (m *Module) SetLoadLevel(level int)
- func (m *Module) TryEnable(init bool) (enabled bool, retry bool)
- type ModuleNotLoadedError
Constants ¶
const ( LoadLevelLast = -1 LoadLevelNormal = 0 LoadLevelLater = 1 )
Load Levels
Variables ¶
This section is empty.
Functions ¶
func LoadEnabledModulesConfig ¶
func LoadEnabledModulesConfig(data []byte)
LoadEnabledModulesConfig loads the list of enabled modules from the given config data
Types ¶
type Module ¶
type Module struct { Status enableable Name string ConfigKey string LoadAfterModules []string LoadBeforeModules []string LoadLevel int Init func() RegisterHTTPHandlers func(r *mux.Router) Reload func() // contains filtered or unexported fields }
Module is a struct holding information about the different parts of orpheus. Orpheus is split into modules that can be activated separately.
func (Module) CheckEnabled ¶
CheckEnabled checks if the module is enabled and returns a ModuleNotLoadedError if not
func (*Module) LoadAfter ¶
LoadAfter specifies modules that must be loaded before this module is loaded
func (*Module) LoadBefore ¶
LoadBefore specifies modules that must be loaded after this module is loaded
func (Module) NotLoadedError ¶
func (m Module) NotLoadedError() ModuleNotLoadedError
NotLoadedError creates a ModuleNotLoadedError for this Module
func (*Module) SetLoadLevel ¶
SetLoadLevel sets the load level for this module. A higher load level means that it is loaded later.
type ModuleNotLoadedError ¶
type ModuleNotLoadedError struct {
// contains filtered or unexported fields
}
ModuleNotLoadedError is an error type for when a module is not loaded, but used
func NewModuleNotLoadedError ¶
func NewModuleNotLoadedError(moduleName string) ModuleNotLoadedError
NewModuleNotLoadedError creates a new ModuleNotLoadedError
func (ModuleNotLoadedError) Error ¶
func (err ModuleNotLoadedError) Error() string