Documentation
¶
Index ¶
- type AppModule
- type AppModuleConfig
- type BaseAppModule
- func (b *BaseAppModule) BeforeDestroy(fn func(mod AppModule) error)
- func (b *BaseAppModule) BeforeStart(fn func(mod AppModule) error)
- func (b BaseAppModule) Config() AppModuleConfig
- func (b *BaseAppModule) Destroy() error
- func (b *BaseAppModule) Init() error
- func (b *BaseAppModule) SetConfig(config AppModuleConfig)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppModule ¶
type AppModule interface {
SetConfig(config AppModuleConfig)
Config() AppModuleConfig
Init() error
Destroy() error
BeforeStart(fn func(mod AppModule) error)
//AfterStart(func(arg ...interface{})) error
BeforeDestroy(fn func(mod AppModule) error)
}
AppModule interface
type AppModuleConfig ¶
AppModuleConfig interface
func NewConfig ¶
func NewConfig(name, version string) AppModuleConfig
NewConfig create new basic config
type BaseAppModule ¶
type BaseAppModule struct {
// contains filtered or unexported fields
}
BaseAppModule is abstract struct layer
func (*BaseAppModule) BeforeDestroy ¶
func (b *BaseAppModule) BeforeDestroy(fn func(mod AppModule) error)
BeforeDestroy - event triggered run before destroy
func (*BaseAppModule) BeforeStart ¶
func (b *BaseAppModule) BeforeStart(fn func(mod AppModule) error)
BeforeStart - event triggered run before init
func (BaseAppModule) Config ¶
func (b BaseAppModule) Config() AppModuleConfig
Config returns app module config
func (*BaseAppModule) SetConfig ¶
func (b *BaseAppModule) SetConfig(config AppModuleConfig)
SetConfig set config to app module
Click to show internal directories.
Click to hide internal directories.