Documentation
¶
Index ¶
- func Run(app Service)
- func Since() time.Duration
- type BasicService
- func (app *BasicService) AddModule(mod module.Module) module.Module
- func (app *BasicService) Busy() bool
- func (app *BasicService) Discovery() discovery.Discovery
- func (app *BasicService) ID() int64
- func (app *BasicService) Init() error
- func (app *BasicService) MQ() mq.Conn
- func (app *BasicService) Name() string
- func (app *BasicService) SetState(state State) error
- func (app *BasicService) Shutdown() error
- func (app *BasicService) Start() error
- func (app *BasicService) State() State
- func (app *BasicService) UUID() string
- func (app *BasicService) 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 BasicService ¶ added in v0.1.2
type BasicService struct {
// contains filtered or unexported fields
}
BasicService implements Service
func NewBasicService ¶ added in v0.1.2
func NewBasicService(self Service, cfg config.Configurator) *BasicService
NewBasicService creates a BasicService
func (*BasicService) AddModule ¶ added in v0.1.2
func (app *BasicService) AddModule(mod module.Module) module.Module
AddModule adds a module to service
func (*BasicService) Busy ¶ added in v0.1.2
func (app *BasicService) Busy() bool
Busy implements Service Busy method
func (*BasicService) Discovery ¶ added in v0.1.2
func (app *BasicService) Discovery() discovery.Discovery
Discovery returns the discovery engine
func (*BasicService) ID ¶ added in v0.1.2
func (app *BasicService) ID() int64
ID implements Service ID method
func (*BasicService) Init ¶ added in v0.1.2
func (app *BasicService) Init() error
Init implements Service Init method
func (*BasicService) MQ ¶ added in v0.1.2
func (app *BasicService) MQ() mq.Conn
MQ returns the mq engine
func (*BasicService) Name ¶ added in v0.1.2
func (app *BasicService) Name() string
Name implements Service Name method
func (*BasicService) SetState ¶ added in v0.1.2
func (app *BasicService) SetState(state State) error
SetState implements Service SetState method
func (*BasicService) Shutdown ¶ added in v0.1.2
func (app *BasicService) Shutdown() error
Shutdown implements Service Shutdown method
func (*BasicService) Start ¶ added in v0.1.2
func (app *BasicService) Start() error
Start implements Service Start method
func (*BasicService) State ¶ added in v0.1.2
func (app *BasicService) State() State
State returns state of service
func (*BasicService) UUID ¶ added in v0.1.2
func (app *BasicService) 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.