Documentation ¶
Index ¶
- Variables
- func RegisterComponent(scenario, componentName string, componentCreator protocol.ComponentCreator)
- func RegisterLegacyComponent(scenario, componentName string, componentCreator protocol.RenderCreator)
- func RegisterProviderComponent(scenario, componentName string, providerPtr ComponentCreatorAndProvider, ...)
- type ComponentCreatorAndProvider
- type HubListener
- type OpFunc
- type Option
Constants ¶
This section is empty.
Variables ¶
var AllExplicitProviderCreatorMap = map[string]servicehub.Provider{}
AllExplicitProviderCreatorMap contains all user specified provider.
Functions ¶
func RegisterComponent ¶
func RegisterComponent(scenario, componentName string, componentCreator protocol.ComponentCreator)
RegisterComponent register legacy component which implements protocol.RenderCreator
func RegisterLegacyComponent ¶
func RegisterLegacyComponent(scenario, componentName string, componentCreator protocol.RenderCreator)
RegisterLegacyComponent register legacy component which implements protocol.RenderCreator For most scenarios, you should use RegisterComponent.
func RegisterProviderComponent ¶
func RegisterProviderComponent(scenario, componentName string, providerPtr ComponentCreatorAndProvider, opFuncs ...OpFunc)
RegisterProviderComponent register a provider to component. Normally this provider will use servicehub's auto dependency injection feature.
Types ¶
type ComponentCreatorAndProvider ¶
type ComponentCreatorAndProvider interface { cptype.IComponent servicehub.Provider }
ComponentCreatorAndProvider used for RegisterProviderComponent.
type HubListener ¶
HubListener .
func (*HubListener) AfterInitialization ¶
func (l *HubListener) AfterInitialization(h *servicehub.Hub) error
AfterInitialization .
func (*HubListener) AfterStart ¶
func (l *HubListener) AfterStart(h *servicehub.Hub) error
AfterStart .
func (*HubListener) BeforeExit ¶
func (l *HubListener) BeforeExit(h *servicehub.Hub, err error) error
BeforeExit .
func (*HubListener) BeforeInitialization ¶
func (l *HubListener) BeforeInitialization(h *servicehub.Hub, config map[string]interface{}) error
BeforeInitialization .
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option represents options when register.
func (*Option) WithCustomProviderSpecButCreator ¶
func (o *Option) WithCustomProviderSpecButCreator(spec *servicehub.Spec)
WithCustomProviderSpecButCreator use custom spec as base but ignore creator.