Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Plugin ¶
type Plugin struct { Path string // contains filtered or unexported fields }
type Service ¶
type Service struct { // Logger a zerolog instance that can be employed to log service details within plugins Logger *zerolog.Logger // contains filtered or unexported fields }
Service is the main structure that contains all the service details, the methods to attach custom plugins and the ones to start it
func NewService ¶
func NewService(opts ServiceOpts) *Service
NewService instantiate a Service which can be employed to connect custom plugin and start listening on defined endpoints
func (*Service) Inject ¶ added in v0.2.1
func (s *Service) Inject(w http.ResponseWriter, r *http.Request)
Inject allows to test an endpoint by passing a request and response recorder
func (*Service) Register ¶
Register include the new plugin into the set of plugins that the service must load.
type ServiceOpts ¶ added in v0.2.0
type ServiceOpts struct { // Name represents the designation emplyoyed to indentify the service's deploy Name string // Version is a semver string that represents the current version of deployed service Version string // LogLevel is a string indicating the minimum log level that is shown on the standard out LogLevel string // StatusManager is an interface providing the three status routes handlers StatusManager status.Status // MetricsManager is an interface providing a method to register custom metrics in the service registry MetricsManager metrics.Metrics }
ServiceOpts defines which options are needed to customize a Service initialization
Click to show internal directories.
Click to hide internal directories.