Documentation ¶
Index ¶
- type Interface
- type Module
- func (m *Module) HookConstructed(callback func(), opts ...event.Option) *event.Hook[func()]
- func (m *Module) HookInitialized(callback func(), opts ...event.Option) *event.Hook[func()]
- func (m *Module) HookStopped(callback func(), opts ...event.Option) *event.Hook[func()]
- func (m *Module) TriggerConstructed()
- func (m *Module) TriggerInitialized()
- func (m *Module) TriggerStopped()
- func (m *Module) WasConstructed() bool
- func (m *Module) WasInitialized() bool
- func (m *Module) WasStopped() bool
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // TriggerConstructed triggers the constructed event. TriggerConstructed() // WasConstructed returns true if the constructed event was triggered. WasConstructed() bool // HookConstructed registers a callback for the constructed event. HookConstructed(func(), ...event.Option) *event.Hook[func()] // TriggerInitialized triggers the initialized event. TriggerInitialized() // WasInitialized returns true if the initialized event was triggered. WasInitialized() bool // HookInitialized registers a callback for the initialized event. HookInitialized(func(), ...event.Option) *event.Hook[func()] // TriggerStopped triggers the stopped event. TriggerStopped() // WasStopped returns true if the stopped event was triggered. WasStopped() bool // HookStopped registers a callback for the stopped event. HookStopped(func(), ...event.Option) *event.Hook[func()] }
Interface defines the interface of a module.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is a trait that exposes a lifecycle related API, that can be used to create a modular architecture where different modules can listen and wait for each other to reach certain states.
func (*Module) HookConstructed ¶
HookConstructed registers a callback for the constructed event.
func (*Module) HookInitialized ¶
HookInitialized registers a callback for the initialized event.
func (*Module) HookStopped ¶
HookStopped registers a callback for the stopped event.
func (*Module) TriggerConstructed ¶
func (m *Module) TriggerConstructed()
TriggerConstructed triggers the constructed event.
func (*Module) TriggerInitialized ¶
func (m *Module) TriggerInitialized()
TriggerInitialized triggers the initialized event.
func (*Module) TriggerStopped ¶
func (m *Module) TriggerStopped()
TriggerStopped triggers the stopped event.
func (*Module) WasConstructed ¶
WasConstructed returns true if the constructed event was triggered.
func (*Module) WasInitialized ¶
WasInitialized returns true if the initialized event was triggered.
func (*Module) WasStopped ¶
WasStopped returns true if the stopped event was triggered.