Documentation
¶
Index ¶
- Variables
- func SetLogLevel(level log.Level)
- type Component
- type ComponentInstConfig
- type DefaultComponent
- func (dfc *DefaultComponent) Create(*ComponentInstConfig) (interface{}, error)
- func (dfc *DefaultComponent) Destroy(inst interface{}, c *ComponentInstConfig) error
- func (dfc *DefaultComponent) Init(inst interface{}, c *ComponentInstConfig) error
- func (dfc *DefaultComponent) Start(inst interface{}, c *ComponentInstConfig) error
- func (dfc *DefaultComponent) Stop(inst interface{}, c *ComponentInstConfig) error
- func (dfc *DefaultComponent) Update(inst interface{}, c *ComponentInstConfig) error
- type PBC
- func (pb *PBC) CreateInstance(instConfig *ComponentInstConfig) (interface{}, error)
- func (pb *PBC) DestroyAll() error
- func (pb *PBC) DestroyInstance(name string) error
- func (pb *PBC) Init(instConfigs []*ComponentInstConfig) error
- func (pb *PBC) InitInstance(name string) error
- func (pb *PBC) Instance(name string) interface{}
- func (pb *PBC) RegisterComponent(compID string, comp Component) error
- func (pb *PBC) StartInstance(name string) error
- func (pb *PBC) StopInstance(name string) error
- func (pb *PBC) UpdateInstance(name string, instConfig *ComponentInstConfig) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ComponentNotImplemented = errors.New("Component Not Implemented")
Functions ¶
func SetLogLevel ¶
Types ¶
type Component ¶
type Component interface { Create(*ComponentInstConfig) (interface{}, error) Init(inst interface{}, c *ComponentInstConfig) error Start(inst interface{}, c *ComponentInstConfig) error Stop(inst interface{}, c *ComponentInstConfig) error Update(inst interface{}, c *ComponentInstConfig) error Destroy(inst interface{}, c *ComponentInstConfig) error }
type ComponentInstConfig ¶
type DefaultComponent ¶
type DefaultComponent struct{}
默认组件实现
func (*DefaultComponent) Create ¶
func (dfc *DefaultComponent) Create(*ComponentInstConfig) (interface{}, error)
func (*DefaultComponent) Destroy ¶
func (dfc *DefaultComponent) Destroy(inst interface{}, c *ComponentInstConfig) error
func (*DefaultComponent) Init ¶
func (dfc *DefaultComponent) Init(inst interface{}, c *ComponentInstConfig) error
func (*DefaultComponent) Start ¶
func (dfc *DefaultComponent) Start(inst interface{}, c *ComponentInstConfig) error
func (*DefaultComponent) Stop ¶
func (dfc *DefaultComponent) Stop(inst interface{}, c *ComponentInstConfig) error
func (*DefaultComponent) Update ¶
func (dfc *DefaultComponent) Update(inst interface{}, c *ComponentInstConfig) error
type PBC ¶
type PBC struct {
// contains filtered or unexported fields
}
keywea component
func (*PBC) CreateInstance ¶
func (pb *PBC) CreateInstance(instConfig *ComponentInstConfig) (interface{}, error)
组件实例
func (*PBC) DestroyAll ¶
func (*PBC) Init ¶
func (pb *PBC) Init(instConfigs []*ComponentInstConfig) error
func (*PBC) RegisterComponent ¶
注册组件
func (*PBC) UpdateInstance ¶
func (pb *PBC) UpdateInstance(name string, instConfig *ComponentInstConfig) error
实例更新
Click to show internal directories.
Click to hide internal directories.