Documentation ¶
Index ¶
- func TriggerHook[A any](p *PluginController, name string, arg A) error
- type HookEntries
- type HookEntry
- type HookID
- type NewInstanceFunction
- type PluginController
- func (p *PluginController) AddPlugin(pluginID umid.UMID, f NewInstanceFunction) (PluginInstance, error)
- func (p *PluginController) NewPluginInterface(id PluginID) PluginInterface
- func (p *PluginController) UnsubscribeAllHooks(plugin PluginInterface) error
- func (p *PluginController) UnsubscribeHookByHookId(plugin PluginInterface, id HookID) error
- func (p *PluginController) UnsubscribeHooksByName(plugin PluginInterface, name string) error
- func (p *PluginController) ValidPlugin(id PluginID, secret umid.UMID) bool
- type PluginID
- type PluginInstance
- type PluginInterface
- type PluginSubscriberInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TriggerHook ¶
func TriggerHook[A any](p *PluginController, name string, arg A) error
TODO: fix the bloody thing
Types ¶
type HookEntries ¶
func NewHookEntries ¶
func NewHookEntries[A any]() *HookEntries[A]
func (*HookEntries[A]) Add ¶
func (s *HookEntries[A]) Add(hook func(A) error, pluginID PluginID) HookID
func (*HookEntries[A]) Num ¶
func (s *HookEntries[A]) Num() int
func (*HookEntries[A]) RemoveByHookID ¶
func (s *HookEntries[A]) RemoveByHookID(hookID HookID) bool
func (*HookEntries[A]) RemoveByPluginID ¶
func (s *HookEntries[A]) RemoveByPluginID(pluginID PluginID) bool
func (*HookEntries[A]) Run ¶
func (s *HookEntries[A]) Run(arg A) error
type HookID ¶
func PluginSubscribeHook ¶
type NewInstanceFunction ¶
type NewInstanceFunction func(pluginInterface PluginInterface) (PluginInstance, error)
type PluginController ¶
type PluginController struct {
// contains filtered or unexported fields
}
func NewPluginController ¶
func NewPluginController(parent umid.UMID) *PluginController
func (*PluginController) AddPlugin ¶
func (p *PluginController) AddPlugin(pluginID umid.UMID, f NewInstanceFunction) (PluginInstance, error)
func (*PluginController) NewPluginInterface ¶
func (p *PluginController) NewPluginInterface(id PluginID) PluginInterface
func (*PluginController) UnsubscribeAllHooks ¶
func (p *PluginController) UnsubscribeAllHooks(plugin PluginInterface) error
func (*PluginController) UnsubscribeHookByHookId ¶
func (p *PluginController) UnsubscribeHookByHookId(plugin PluginInterface, id HookID) error
func (*PluginController) UnsubscribeHooksByName ¶
func (p *PluginController) UnsubscribeHooksByName(plugin PluginInterface, name string) error
func (*PluginController) ValidPlugin ¶
func (p *PluginController) ValidPlugin(id PluginID, secret umid.UMID) bool
type PluginInstance ¶
type PluginInstance any
type PluginInterface ¶
type PluginInterface interface { GetId() PluginID GetWorld() umid.UMID GetSecret() umid.UMID //SubscribeHook(name string, hook any) (HookID, error) UnsubscribeAllHooks() error UnsubscribeHooksByName(name string) error UnsubscribeHookByHookId(id HookID) error // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.