Commit f0f6d0e9 by bergquist

registry: adds comments to interfaces

parent cb706bd0
...@@ -34,12 +34,23 @@ func GetServices() []*Descriptor { ...@@ -34,12 +34,23 @@ func GetServices() []*Descriptor {
return services return services
} }
// Service interface is the lowest common shape that services
// are expected to forfill to be started within Grafana.
type Service interface { type Service interface {
// Init is called by Grafana main process which gives the service
// the possibility do some initial work before its started. Things
// like adding routes, bus handlers should be done in the Init function
Init() error Init() error
} }
// Useful for alerting service // CanBeDisabled allows the services to decide if it should
// be started or not by itself. This is useful for services
// that might not always be started, ex alerting.
// This will be called after `Init()`.
type CanBeDisabled interface { type CanBeDisabled interface {
// IsDisabled should return a bool saying if it can be started or not.
IsDisabled() bool IsDisabled() bool
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment