Documentation
¶
Index ¶
- Constants
- Variables
- func NewPluginManager(lc fx.Lifecycle, adaptors *adaptors.Adaptors, bus bus.Bus, ...) common.PluginManager
- func RegisterPlugin(name string, new func() Plugable)
- type Installable
- type Plugable
- type Plugin
- func (p *Plugin) Depends() []string
- func (p *Plugin) GetPlugin(name string) (interface{}, error)
- func (p *Plugin) Load(service Service) error
- func (p *Plugin) LoadSettings(pl Plugable) (settings m.Attributes, err error)
- func (p *Plugin) Name() string
- func (p *Plugin) Options() m.PluginOptions
- func (p *Plugin) Type() PluginType
- func (p *Plugin) Unload() error
- func (p *Plugin) Version() string
- type PluginType
- type Service
Constants ¶
View Source
const ( // PluginBuiltIn ... PluginBuiltIn = PluginType("System") // PluginInstallable ... PluginInstallable = PluginType("Installable") )
Variables ¶
Functions ¶
func NewPluginManager ¶
func NewPluginManager(lc fx.Lifecycle, adaptors *adaptors.Adaptors, bus bus.Bus, entityManager entity_manager.EntityManager, mqttServ mqtt.MqttServ, scriptService scripts.ScriptService, appConfig *m.AppConfig, gateClient *gate_client.GateClient, eventBus bus.Bus) common.PluginManager
NewPluginManager ...
Types ¶
type Plugable ¶
type Plugable interface {
Load(Service) error
Unload() error
Name() string
Type() PluginType
Depends() []string
Version() string
Options() m.PluginOptions
}
Plugable ...
type Plugin ¶
type Plugin struct {
EntityManager entity_manager.EntityManager
Adaptors *adaptors.Adaptors
ScriptService scripts.ScriptService
PluginManager common.PluginManager
EventBus bus.Bus
IsStarted *atomic.Bool
}
Plugin ...
func (*Plugin) LoadSettings ¶
func (p *Plugin) LoadSettings(pl Plugable) (settings m.Attributes, err error)
LoadSettings ...
type Service ¶
type Service interface {
Plugins() map[string]Plugable
PluginManager() common.PluginManager
EventBus() bus.Bus
Adaptors() *adaptors.Adaptors
EntityManager() entity_manager.EntityManager
ScriptService() scripts.ScriptService
MqttServ() mqtt.MqttServ
AppConfig() *m.AppConfig
GateClient() *gate_client.GateClient
}
Service ...
Click to show internal directories.
Click to hide internal directories.