Documentation ¶
Index ¶
- type Endpoint
- type Service
- func (s *Service) HealthEndpoint(endpointPrefix string) *Service
- func (s *Service) MetricsEndpoint(endpointPrefix string) *Service
- func (s *Service) ModulesSortedByStartOrder() []interface{}
- func (s *Service) RegisterModules(startOrder int, stopOrder int, ifaces ...interface{})
- func (s *Service) Start() error
- func (s *Service) Stop() error
- func (s *Service) WebServer() *webserver.WebServer
- type Startable
- type Stopable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the main struct for controlling a guble server
func New ¶
New creates a new Service, using the given Router and WebServer. If the router has already a configured Cluster, it is registered as a service module. The Router and Webserver are then registered as modules.
func (*Service) HealthEndpoint ¶
HealthEndpoint sets the endpoint used for health. Parameter for disabling the endpoint is: "". Returns the updated service.
func (*Service) MetricsEndpoint ¶
MetricsEndpoint sets the endpoint used for metrics. Parameter for disabling the endpoint is: "". Returns the updated service.
func (*Service) ModulesSortedByStartOrder ¶
func (s *Service) ModulesSortedByStartOrder() []interface{}
ModulesSortedByStartOrder returns the registered modules sorted by their startOrder property
func (*Service) RegisterModules ¶
RegisterModules adds more modules (which can be Startable, Stopable, Endpoint etc.) to the service, with their start and stop ordering across all the service's modules.
func (*Service) Start ¶
Start checks the modules for the following interfaces and registers and/or starts:
Startable: health.Checker: Endpoint: Register the handler function of the Endpoint in the http service at prefix