|
|
|
|
@ -34,12 +34,23 @@ func GetServices() []*Descriptor { |
|
|
|
|
return services |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Service interface is the lowest common shape that services
|
|
|
|
|
// are expected to forfill to be started within Grafana.
|
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 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 { |
|
|
|
|
|
|
|
|
|
// IsDisabled should return a bool saying if it can be started or not.
|
|
|
|
|
IsDisabled() bool |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|