Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 60seconds * 60minutes * 24hours * 15 days RETENTION_PERIOD_15_DAYS_IN_SECONDS = 1_296_000 // 60seconds * 60minutes * 24hours * 7 days * 9 weeks RETENTION_PERIOD_9_WEEKS_IN_SECONDS = 5_443_200 // 60seconds * 60minutes * 24hours * 7 days * (52 + 52 + 4)weeks RETENTION_PERIOD_25_MONTHS_IN_SECONDS = 65_318_400 DURATION_KEY_WEEK = "week" DURATION_KEY_MONTH = "month" DURATION_KEY_YEAR = "year" DURATION_KEY_FOREVER = "forever" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeviceRepo ¶
type DeviceRepo interface { Close() error HealthCheck(ctx context.Context) error RegisterDevice(ctx context.Context, dev models.Device) error GetDevices(ctx context.Context) ([]models.Device, error) UpdateDevice(ctx context.Context, wwn string, collectorSmartData collector.SmartInfo) (models.Device, error) UpdateDeviceStatus(ctx context.Context, wwn string, status pkg.DeviceStatus) (models.Device, error) GetDeviceDetails(ctx context.Context, wwn string) (models.Device, error) DeleteDevice(ctx context.Context, wwn string) error SaveSmartAttributes(ctx context.Context, wwn string, collectorSmartData collector.SmartInfo) (measurements.Smart, error) GetSmartAttributeHistory(ctx context.Context, wwn string, durationKey string, selectEntries int, selectEntriesOffset int, attributes []string) ([]measurements.Smart, error) SaveSmartTemperature(ctx context.Context, wwn string, deviceProtocol string, collectorSmartData collector.SmartInfo) error GetSummary(ctx context.Context) (map[string]*models.DeviceSummary, error) GetSmartTemperatureHistory(ctx context.Context, durationKey string) (map[string][]measurements.SmartTemperature, error) LoadSettings(ctx context.Context) (*models.Settings, error) SaveSettings(ctx context.Context, settings models.Settings) error }
Create mock using: mockgen -source=webapp/backend/pkg/database/interface.go -destination=webapp/backend/pkg/database/mock/mock_database.go
func NewScrutinyRepository ¶
func NewScrutinyRepository(appConfig config.Interface, globalLogger logrus.FieldLogger) (DeviceRepo, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
migrations
|
|
Package mock_database is a generated GoMock package.
|
Package mock_database is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.