Documentation ¶
Index ¶
- Constants
- type Option
- type ServiceContext
- func (sc *ServiceContext) Account() *types.Account
- func (sc *ServiceContext) AllServices() ([]common.Service, error)
- func (sc *ServiceContext) Config() (*config.Config, error)
- func (sc *ServiceContext) ConfigFile() string
- func (sc *ServiceContext) ConfigManager(opts ...Option) (*config.CfgManager, error)
- func (sc *ServiceContext) EventBus() event.EventBus
- func (sc *ServiceContext) HasService(name string) bool
- func (sc *ServiceContext) Id() string
- func (sc *ServiceContext) Init(fn func() error) error
- func (sc *ServiceContext) Register(name string, service common.Service) error
- func (sc *ServiceContext) Service(name string) (common.Service, error)
- func (sc *ServiceContext) SetAccount(account *types.Account)
- func (sc *ServiceContext) Start() error
- func (sc *ServiceContext) Status() int32
- func (sc *ServiceContext) Stop() error
- func (sc *ServiceContext) UnRegister(name string) error
Constants ¶
View Source
const ( LogService = "logService" ContractService = "contractService" RPCService = "rpcService" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(cm *config.CfgManager) error
type ServiceContext ¶
type ServiceContext struct { common.ServiceLifecycle // contains filtered or unexported fields }
func NewServiceContext ¶
func NewServiceContext(cfgFile string) *ServiceContext
func (*ServiceContext) Account ¶
func (sc *ServiceContext) Account() *types.Account
func (*ServiceContext) AllServices ¶
func (sc *ServiceContext) AllServices() ([]common.Service, error)
func (*ServiceContext) ConfigFile ¶
func (sc *ServiceContext) ConfigFile() string
func (*ServiceContext) ConfigManager ¶
func (sc *ServiceContext) ConfigManager(opts ...Option) (*config.CfgManager, error)
func (*ServiceContext) EventBus ¶
func (sc *ServiceContext) EventBus() event.EventBus
func (*ServiceContext) HasService ¶
func (sc *ServiceContext) HasService(name string) bool
func (*ServiceContext) Id ¶
func (sc *ServiceContext) Id() string
func (*ServiceContext) Init ¶
func (sc *ServiceContext) Init(fn func() error) error
func (*ServiceContext) Register ¶
func (sc *ServiceContext) Register(name string, service common.Service) error
func (*ServiceContext) Service ¶
func (sc *ServiceContext) Service(name string) (common.Service, error)
func (*ServiceContext) SetAccount ¶
func (sc *ServiceContext) SetAccount(account *types.Account)
func (*ServiceContext) Start ¶
func (sc *ServiceContext) Start() error
func (*ServiceContext) Status ¶
func (sc *ServiceContext) Status() int32
func (*ServiceContext) Stop ¶
func (sc *ServiceContext) Stop() error
func (*ServiceContext) UnRegister ¶
func (sc *ServiceContext) UnRegister(name string) error
Click to show internal directories.
Click to hide internal directories.