Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExternalServiceList ¶
type ExternalServiceList struct {
HealthCheck bool
Init Initialiser
}
ExternalServiceList holds the initialiser and initialisation state of external services.
func NewServiceList ¶
func NewServiceList(initialiser Initialiser) *ExternalServiceList
NewServiceList creates a new service list with the provided initialiser
func (*ExternalServiceList) GetHealthCheck ¶
func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
GetHealthCheck creates a healthcheck with versionInfo and sets the HealthCheck flag to true
type HealthChecker ¶
type HealthChecker interface {
Handler(w http.ResponseWriter, req *http.Request)
Start(ctx context.Context)
Stop()
AddCheck(name string, checker healthcheck.Checker) (err error)
}
HealthChecker defines the required methods from Healthcheck
type Init ¶
type Init struct{}
Init implements the Initialiser interface to initialise dependencies
func (*Init) DoGetHealthCheck ¶
func (e *Init) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
DoGetHealthCheck creates a healthcheck with versionInfo
type Initialiser ¶
type Initialiser interface {
DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
}
Initialiser defines the methods to initialise external services
Click to show internal directories.
Click to hide internal directories.