12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package mhayaFacade
- type (
- IComponent interface {
- Name() string
- App() IApplication
- IComponentLifecycle
- }
- IComponentLifecycle interface {
- Set(app IApplication)
- Init()
- OnAfterInit()
- OnBeforeStop()
- OnStop()
- }
- )
- // Component base component
- type Component struct {
- app IApplication
- }
- func (*Component) Name() string {
- return ""
- }
- func (p *Component) App() IApplication {
- return p.app
- }
- func (p *Component) Set(app IApplication) {
- p.app = app
- }
- func (*Component) Init() {
- }
- func (*Component) OnAfterInit() {
- }
- func (*Component) OnBeforeStop() {
- }
- func (*Component) OnStop() {
- }
|