Documentation
¶
Index ¶
- type GracefulStopper
- type Initer
- type Manager
- func (m *Manager) GracefulStop(ctx context.Context) error
- func (m *Manager) Init(ctx context.Context) error
- func (m *Manager) Inject(components ...interface{})
- func (m *Manager) Register(components ...interface{})
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop(ctx context.Context) error
- type Starter
- type Stopper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GracefulStopper ¶ added in v0.9.0
GracefulStopper interface provides method to end work with other components.
type Initer ¶ added in v0.6.3
Initer interface provides method to init a component. During initialization components may NOT be ready. Only safe methods (e.g. not dependant on other components) can be called during initialization.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provide methods to manage components lifecycle
func NewManager ¶ added in v0.7.5
NewManager creates new component manager
func (*Manager) GracefulStop ¶ added in v0.9.0
Stop invokes Stop method of all components which implements Starter interface
func (*Manager) Init ¶ added in v0.6.3
Init invokes Init method of all components which implements Initer interface
func (*Manager) Inject ¶ added in v0.6.3
func (m *Manager) Inject(components ...interface{})
Inject components in Manager and inject required dependencies Inject can inject interfaces only, tag public struct fields with `inject:""`
func (*Manager) Register ¶
func (m *Manager) Register(components ...interface{})
Register components in Manager and inject required dependencies. Register can inject interfaces only, tag public struct fields with `inject:""`. If the injectable struct already has a value on the tagged field, the value WILL NOT be overridden.