Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DevMode means development mode. DevMode = "dev" // TestMode means test mode. TestMode = "test" // PreMode means pre-release mode. PreMode = "pre" // ProMode means production mode. ProMode = "pro" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
Service is the interface that groups Start and Stop methods.
func WithStarter ¶
WithStarter wraps a Starter as a Service.
type ServiceConf ¶
type ServiceConf struct { Name string Log logx.LogConf Mode string `json:",default=pro,options=dev|test|rt|pre|pro"` MetricsUrl string `json:",optional"` Prometheus prometheus.Config `json:",optional"` }
A ServiceConf is a service config.
func (ServiceConf) MustSetUp ¶
func (sc ServiceConf) MustSetUp()
MustSetUp sets up the service, exits on error.
type ServiceGroup ¶
type ServiceGroup struct {
// contains filtered or unexported fields
}
A ServiceGroup is a group of services.
func (*ServiceGroup) Start ¶
func (sg *ServiceGroup) Start()
Start starts the ServiceGroup. There should not be any logic code after calling this method, because this method is a blocking one. Also, quitting this method will close the logx output.
Click to show internal directories.
Click to hide internal directories.