Documentation ¶
Index ¶
- type ChecksController
- func (cc *ChecksController) GenerateCheckSpecs(ctx context.Context) (openapi3.T, error)
- func (cc *ChecksController) Reconcile(ctx context.Context, cfg runtime.Config)
- func (cc *ChecksController) RegisterCheck(ctx context.Context, check checks.Check) error
- func (cc *ChecksController) Run(ctx context.Context) error
- func (cc *ChecksController) Shutdown(ctx context.Context) (err error)
- func (cc *ChecksController) UnregisterCheck(ctx context.Context, check checks.Check) error
- type ErrCreateOpenapiSchema
- type ErrRunningCheck
- type ErrShutdown
- type Metrics
- type MetricsMock
- type PrometheusMetrics
- type Sparrow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksController ¶ added in v0.3.1
type ChecksController struct {
// contains filtered or unexported fields
}
ChecksController is responsible for managing checks.
func NewChecksController ¶ added in v0.3.1
func NewChecksController(dbase db.DB, metrics Metrics) *ChecksController
NewChecksController creates a new ChecksController.
func (*ChecksController) GenerateCheckSpecs ¶ added in v0.3.1
GenerateCheckSpecs generates the OpenAPI specifications for the given checks Returns the complete OpenAPI specification for all checks
func (*ChecksController) Reconcile ¶ added in v0.3.1
func (cc *ChecksController) Reconcile(ctx context.Context, cfg runtime.Config)
Reconcile reconciles the checks. It registers new checks, updates existing checks and unregisters checks not in the new config.
func (*ChecksController) RegisterCheck ¶ added in v0.3.1
RegisterCheck registers a new check.
func (*ChecksController) Run ¶ added in v0.3.1
func (cc *ChecksController) Run(ctx context.Context) error
Run runs the ChecksController with handling results and errors.
func (*ChecksController) Shutdown ¶ added in v0.3.1
func (cc *ChecksController) Shutdown(ctx context.Context) (err error)
Shutdown shuts down the ChecksController.
func (*ChecksController) UnregisterCheck ¶ added in v0.3.1
UnregisterCheck unregisters a check.
type ErrCreateOpenapiSchema ¶
type ErrCreateOpenapiSchema struct {
// contains filtered or unexported fields
}
func (ErrCreateOpenapiSchema) Error ¶ added in v0.3.1
func (e ErrCreateOpenapiSchema) Error() string
type ErrRunningCheck ¶ added in v0.3.1
func (*ErrRunningCheck) Error ¶ added in v0.3.1
func (e *ErrRunningCheck) Error() string
type ErrShutdown ¶ added in v0.3.1
type ErrShutdown struct {
// contains filtered or unexported fields
}
func (ErrShutdown) HasError ¶ added in v0.3.1
func (e ErrShutdown) HasError() bool
type Metrics ¶ added in v0.1.2
type Metrics interface { // GetRegistry returns the prometheus registry instance // containing the registered prometheus collectors GetRegistry() *prometheus.Registry }
func NewMetrics ¶ added in v0.1.2
func NewMetrics() Metrics
NewMetrics initializes the metrics and returns the PrometheusMetrics
type MetricsMock ¶ added in v0.1.2
type MetricsMock struct { // GetRegistryFunc mocks the GetRegistry method. GetRegistryFunc func() *prometheus.Registry // contains filtered or unexported fields }
MetricsMock is a mock implementation of Metrics.
func TestSomethingThatUsesMetrics(t *testing.T) { // make and configure a mocked Metrics mockedMetrics := &MetricsMock{ GetRegistryFunc: func() *prometheus.Registry { panic("mock out the GetRegistry method") }, } // use mockedMetrics in code that requires Metrics // and then make assertions. }
func (*MetricsMock) GetRegistry ¶ added in v0.1.2
func (mock *MetricsMock) GetRegistry() *prometheus.Registry
GetRegistry calls GetRegistryFunc.
func (*MetricsMock) GetRegistryCalls ¶ added in v0.1.2
func (mock *MetricsMock) GetRegistryCalls() []struct { }
GetRegistryCalls gets all the calls that were made to GetRegistry. Check the length with:
len(mockedMetrics.GetRegistryCalls())
type PrometheusMetrics ¶ added in v0.1.2
type PrometheusMetrics struct {
// contains filtered or unexported fields
}
func (*PrometheusMetrics) GetRegistry ¶ added in v0.1.2
func (m *PrometheusMetrics) GetRegistry() *prometheus.Registry
GetRegistry returns the registry to register prometheus metrics