Documentation ¶
Index ¶
- func Run(app Service)
- func Since() time.Duration
- type BaseService
- func (app *BaseService) AddModule(mod module.Module) module.Module
- func (app *BaseService) Busy() bool
- func (app *BaseService) Discovery() discovery.Discovery
- func (app *BaseService) ID() int64
- func (app *BaseService) Init() error
- func (app *BaseService) MQ() mq.Conn
- func (app *BaseService) Name() string
- func (app *BaseService) SetState(state State) error
- func (app *BaseService) Shutdown() error
- func (app *BaseService) Start() error
- func (app *BaseService) State() State
- func (app *BaseService) UUID() string
- func (app *BaseService) Update(now time.Time, dt time.Duration)
- type ConfigRewriter
- type DiscoveryContent
- type Meta
- type Service
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseService ¶
type BaseService struct {
// contains filtered or unexported fields
}
BaseService implements Service
func NewBaseService ¶
func NewBaseService(self Service, cfg config.Configurator) *BaseService
NewBaseService creates a BaseService
func (*BaseService) AddModule ¶ added in v0.0.18
func (app *BaseService) AddModule(mod module.Module) module.Module
AddModule adds a module to service
func (*BaseService) Busy ¶ added in v0.0.18
func (app *BaseService) Busy() bool
Busy implements Service Busy method
func (*BaseService) Discovery ¶ added in v0.0.18
func (app *BaseService) Discovery() discovery.Discovery
Discovery returns the discovery engine
func (*BaseService) MQ ¶ added in v0.0.18
func (app *BaseService) MQ() mq.Conn
MQ returns the mq engine
func (*BaseService) Name ¶
func (app *BaseService) Name() string
Name implements Service Name method
func (*BaseService) SetState ¶ added in v0.0.18
func (app *BaseService) SetState(state State) error
SetState implements Service SetState method
func (*BaseService) Shutdown ¶
func (app *BaseService) Shutdown() error
Shutdown implements Service Shutdown method
func (*BaseService) Start ¶
func (app *BaseService) Start() error
Start implements Service Start method
func (*BaseService) State ¶ added in v0.0.18
func (app *BaseService) State() State
State returns state of service
func (*BaseService) UUID ¶ added in v0.0.18
func (app *BaseService) UUID() string
UUID implements service UUID method
type ConfigRewriter ¶ added in v0.0.18
ConfigRewriter rewrites Config
type DiscoveryContent ¶ added in v0.0.18
type DiscoveryContent struct { Config any `json:"config"` // config of service State struct { Updated int64 `json:"updated"` PID int `json:"pid"` // process id State State `json:"state"` // run state UUID string `json:"uuid"` // instance uuid } `json:"state"` // runtime state of service }
DiscoveryContent is the content for registering
type Meta ¶ added in v0.0.18
type Meta interface { // ID returns id of service ID() int64 // Name of service Name() string // Global unique instance id of service UUID() string // Busy reports whether the service is busy Busy() bool // State returns state of service State() State }
Meta represents metadata of service
Click to show internal directories.
Click to hide internal directories.