Documentation ¶
Overview ¶
Package services contains implementationm of business logic for different scenarios.
Index ¶
- func CalculateID(name, kind string) string
- type HealthCheck
- type HealthCheckImpl
- type HealthCheckMock
- type MetricsRecorder
- func (r MetricsRecorder) Get(ctx context.Context, kind, name string) (storage.Record, error)
- func (r MetricsRecorder) List(ctx context.Context) ([]storage.Record, error)
- func (r MetricsRecorder) Push(ctx context.Context, record storage.Record) (storage.Record, error)
- func (r MetricsRecorder) PushList(ctx context.Context, records []storage.Record) ([]storage.Record, error)
- type Recorder
- type RecorderMock
- func (m *RecorderMock) Get(ctx context.Context, kind, name string) (storage.Record, error)
- func (m *RecorderMock) List(ctx context.Context) ([]storage.Record, error)
- func (m *RecorderMock) Push(ctx context.Context, record storage.Record) (storage.Record, error)
- func (m *RecorderMock) PushList(ctx context.Context, records []storage.Record) ([]storage.Record, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HealthCheck ¶
type HealthCheckImpl ¶
type HealthCheckImpl struct {
// contains filtered or unexported fields
}
HealthCheckImpl implements general service healthcheck. Currently only database connection is verified.
func NewHealthCheck ¶
func NewHealthCheck(dataStore storage.Storage) HealthCheckImpl
func (HealthCheckImpl) CheckStorage ¶
func (h HealthCheckImpl) CheckStorage(ctx context.Context) error
CheckStorage verifies connection to the database. Fails if database storage is not configured.
type HealthCheckMock ¶
func (*HealthCheckMock) CheckStorage ¶
func (m *HealthCheckMock) CheckStorage(ctx context.Context) error
type MetricsRecorder ¶
type MetricsRecorder struct {
// contains filtered or unexported fields
}
MetricsRecorder implements business logic for metrics writing and reading scenarios.
func NewMetricsRecorder ¶
func NewMetricsRecorder(dataStore storage.Storage) MetricsRecorder
NewMetricsRecorder creatse new NewMetricsRecorder instance with attached storage.
type Recorder ¶
type Recorder interface { Push(ctx context.Context, record storage.Record) (storage.Record, error) PushList(ctx context.Context, records []storage.Record) ([]storage.Record, error) Get(ctx context.Context, kind, name string) (storage.Record, error) List(ctx context.Context) ([]storage.Record, error) }
Click to show internal directories.
Click to hide internal directories.