Documentation ¶
Index ¶
- type CantabularClient
- type Closer
- type ExternalServiceList
- func (e *ExternalServiceList) GetCantabularClient(ctx context.Context, cfg *config.Config) CantabularClient
- func (e *ExternalServiceList) GetGraphDB(ctx context.Context) (api.IGraph, Closer, error)
- func (e *ExternalServiceList) GetHTTPServer(bindAddr string, httpWriteTimeout time.Duration, router http.Handler) IServer
- func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (IHealthCheck, error)
- type IHealthCheck
- type IServer
- type Init
- type Initialiser
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CantabularClient ¶ added in v0.8.0
type CantabularClient interface {
Checker(context.Context, *healthcheck.CheckState) error
}
type ExternalServiceList ¶ added in v0.3.0
type ExternalServiceList struct { Graph bool HealthCheck bool HTTPServer bool Init Initialiser }
ExternalServiceList holds the initialiser and initialisation state of external services.
func NewServiceList ¶ added in v0.3.0
func NewServiceList(initialiser Initialiser) *ExternalServiceList
NewServiceList creates a new service list with the provided initialiser
func (*ExternalServiceList) GetCantabularClient ¶ added in v0.8.0
func (e *ExternalServiceList) GetCantabularClient(ctx context.Context, cfg *config.Config) CantabularClient
func (*ExternalServiceList) GetGraphDB ¶ added in v0.3.0
GetGraphDB creates a graphDB client and sets the Graph flag to true
func (*ExternalServiceList) GetHTTPServer ¶ added in v0.3.0
func (e *ExternalServiceList) GetHTTPServer(bindAddr string, httpWriteTimeout time.Duration, router http.Handler) IServer
GetHTTPServer creates an http server and sets the Server flag to true
func (*ExternalServiceList) GetHealthCheck ¶ added in v0.3.0
func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (IHealthCheck, error)
GetHealthCheck creates a healthcheck with versionInfo and sets teh HealthCheck flag to true
type IHealthCheck ¶ added in v0.3.0
type IHealthCheck interface { Handler(w http.ResponseWriter, req *http.Request) Start(ctx context.Context) Stop() AddCheck(name string, checker healthcheck.Checker) (err error) }
IHealthCheck defines the required methods from Healthcheck
type Init ¶ added in v0.3.0
type Init struct{}
Init implements the Initialiser interface to initialise dependencies
func (*Init) DoGetGraphDB ¶ added in v0.3.0
DoGetGraphDB returns a graphDB
func (*Init) DoGetHTTPServer ¶ added in v0.3.0
func (e *Init) DoGetHTTPServer(bindAddr string, httpWriteTimeout time.Duration, router http.Handler) IServer
DoGetHTTPServer creates an HTTP Server with the provided bind address and router
func (*Init) DoGetHealthCheck ¶ added in v0.3.0
func (e *Init) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (IHealthCheck, error)
DoGetHealthCheck creates a healthcheck with versionInfo
type Initialiser ¶ added in v0.3.0
type Initialiser interface { DoGetHTTPServer(bindAddr string, httpWriteTimeout time.Duration, router http.Handler) IServer DoGetGraphDB(ctx context.Context) (api.IGraph, Closer, error) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (IHealthCheck, error) }
Initialiser defines the methods to initialise external services
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service contains all the configs, server and clients to run the observation API