c3b2eb2b4f
* Generate a UUIDv5 from a random namespace based on WWN, model name, and serial number * Migrate sqlite and influxdb data accordingly * Update frontend API routes and components * Fixes #923
280 lines
12 KiB
Go
280 lines
12 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: webapp/backend/pkg/database/interface.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -source=webapp/backend/pkg/database/interface.go -destination=webapp/backend/pkg/database/mock/mock_database.go
|
|
//
|
|
|
|
// Package mock_database is a generated GoMock package.
|
|
package mock_database
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
pkg "github.com/analogj/scrutiny/webapp/backend/pkg"
|
|
models "github.com/analogj/scrutiny/webapp/backend/pkg/models"
|
|
collector "github.com/analogj/scrutiny/webapp/backend/pkg/models/collector"
|
|
measurements "github.com/analogj/scrutiny/webapp/backend/pkg/models/measurements"
|
|
uuid "github.com/gofrs/uuid/v5"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockDeviceRepo is a mock of DeviceRepo interface.
|
|
type MockDeviceRepo struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockDeviceRepoMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockDeviceRepoMockRecorder is the mock recorder for MockDeviceRepo.
|
|
type MockDeviceRepoMockRecorder struct {
|
|
mock *MockDeviceRepo
|
|
}
|
|
|
|
// NewMockDeviceRepo creates a new mock instance.
|
|
func NewMockDeviceRepo(ctrl *gomock.Controller) *MockDeviceRepo {
|
|
mock := &MockDeviceRepo{ctrl: ctrl}
|
|
mock.recorder = &MockDeviceRepoMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockDeviceRepo) EXPECT() *MockDeviceRepoMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Close mocks base method.
|
|
func (m *MockDeviceRepo) Close() error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Close")
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Close indicates an expected call of Close.
|
|
func (mr *MockDeviceRepoMockRecorder) Close() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockDeviceRepo)(nil).Close))
|
|
}
|
|
|
|
// DeleteDevice mocks base method.
|
|
func (m *MockDeviceRepo) DeleteDevice(ctx context.Context, scrutiny_uuid uuid.UUID) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DeleteDevice", ctx, scrutiny_uuid)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// DeleteDevice indicates an expected call of DeleteDevice.
|
|
func (mr *MockDeviceRepoMockRecorder) DeleteDevice(ctx, scrutiny_uuid any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDevice", reflect.TypeOf((*MockDeviceRepo)(nil).DeleteDevice), ctx, scrutiny_uuid)
|
|
}
|
|
|
|
// GetDeviceDetails mocks base method.
|
|
func (m *MockDeviceRepo) GetDeviceDetails(ctx context.Context, scrutiny_uuid uuid.UUID) (models.Device, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetDeviceDetails", ctx, scrutiny_uuid)
|
|
ret0, _ := ret[0].(models.Device)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetDeviceDetails indicates an expected call of GetDeviceDetails.
|
|
func (mr *MockDeviceRepoMockRecorder) GetDeviceDetails(ctx, scrutiny_uuid any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeviceDetails", reflect.TypeOf((*MockDeviceRepo)(nil).GetDeviceDetails), ctx, scrutiny_uuid)
|
|
}
|
|
|
|
// GetDevices mocks base method.
|
|
func (m *MockDeviceRepo) GetDevices(ctx context.Context) ([]models.Device, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetDevices", ctx)
|
|
ret0, _ := ret[0].([]models.Device)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetDevices indicates an expected call of GetDevices.
|
|
func (mr *MockDeviceRepoMockRecorder) GetDevices(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDevices", reflect.TypeOf((*MockDeviceRepo)(nil).GetDevices), ctx)
|
|
}
|
|
|
|
// GetSmartAttributeHistory mocks base method.
|
|
func (m *MockDeviceRepo) GetSmartAttributeHistory(ctx context.Context, scrutiny_uuid uuid.UUID, durationKey string, selectEntries, selectEntriesOffset int, attributes []string) ([]measurements.Smart, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetSmartAttributeHistory", ctx, scrutiny_uuid, durationKey, selectEntries, selectEntriesOffset, attributes)
|
|
ret0, _ := ret[0].([]measurements.Smart)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetSmartAttributeHistory indicates an expected call of GetSmartAttributeHistory.
|
|
func (mr *MockDeviceRepoMockRecorder) GetSmartAttributeHistory(ctx, scrutiny_uuid, durationKey, selectEntries, selectEntriesOffset, attributes any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSmartAttributeHistory", reflect.TypeOf((*MockDeviceRepo)(nil).GetSmartAttributeHistory), ctx, scrutiny_uuid, durationKey, selectEntries, selectEntriesOffset, attributes)
|
|
}
|
|
|
|
// GetSmartTemperatureHistory mocks base method.
|
|
func (m *MockDeviceRepo) GetSmartTemperatureHistory(ctx context.Context, durationKey string) (map[uuid.UUID][]measurements.SmartTemperature, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetSmartTemperatureHistory", ctx, durationKey)
|
|
ret0, _ := ret[0].(map[uuid.UUID][]measurements.SmartTemperature)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetSmartTemperatureHistory indicates an expected call of GetSmartTemperatureHistory.
|
|
func (mr *MockDeviceRepoMockRecorder) GetSmartTemperatureHistory(ctx, durationKey any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSmartTemperatureHistory", reflect.TypeOf((*MockDeviceRepo)(nil).GetSmartTemperatureHistory), ctx, durationKey)
|
|
}
|
|
|
|
// GetSummary mocks base method.
|
|
func (m *MockDeviceRepo) GetSummary(ctx context.Context) (map[uuid.UUID]*models.DeviceSummary, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetSummary", ctx)
|
|
ret0, _ := ret[0].(map[uuid.UUID]*models.DeviceSummary)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetSummary indicates an expected call of GetSummary.
|
|
func (mr *MockDeviceRepoMockRecorder) GetSummary(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSummary", reflect.TypeOf((*MockDeviceRepo)(nil).GetSummary), ctx)
|
|
}
|
|
|
|
// HealthCheck mocks base method.
|
|
func (m *MockDeviceRepo) HealthCheck(ctx context.Context) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "HealthCheck", ctx)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// HealthCheck indicates an expected call of HealthCheck.
|
|
func (mr *MockDeviceRepoMockRecorder) HealthCheck(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthCheck", reflect.TypeOf((*MockDeviceRepo)(nil).HealthCheck), ctx)
|
|
}
|
|
|
|
// LoadSettings mocks base method.
|
|
func (m *MockDeviceRepo) LoadSettings(ctx context.Context) (*models.Settings, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "LoadSettings", ctx)
|
|
ret0, _ := ret[0].(*models.Settings)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// LoadSettings indicates an expected call of LoadSettings.
|
|
func (mr *MockDeviceRepoMockRecorder) LoadSettings(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadSettings", reflect.TypeOf((*MockDeviceRepo)(nil).LoadSettings), ctx)
|
|
}
|
|
|
|
// RegisterDevice mocks base method.
|
|
func (m *MockDeviceRepo) RegisterDevice(ctx context.Context, dev models.Device) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "RegisterDevice", ctx, dev)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// RegisterDevice indicates an expected call of RegisterDevice.
|
|
func (mr *MockDeviceRepoMockRecorder) RegisterDevice(ctx, dev any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterDevice", reflect.TypeOf((*MockDeviceRepo)(nil).RegisterDevice), ctx, dev)
|
|
}
|
|
|
|
// SaveSettings mocks base method.
|
|
func (m *MockDeviceRepo) SaveSettings(ctx context.Context, settings models.Settings) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SaveSettings", ctx, settings)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// SaveSettings indicates an expected call of SaveSettings.
|
|
func (mr *MockDeviceRepoMockRecorder) SaveSettings(ctx, settings any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSettings", reflect.TypeOf((*MockDeviceRepo)(nil).SaveSettings), ctx, settings)
|
|
}
|
|
|
|
// SaveSmartAttributes mocks base method.
|
|
func (m *MockDeviceRepo) SaveSmartAttributes(ctx context.Context, scrutiny_uuid uuid.UUID, collectorSmartData collector.SmartInfo) (measurements.Smart, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SaveSmartAttributes", ctx, scrutiny_uuid, collectorSmartData)
|
|
ret0, _ := ret[0].(measurements.Smart)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// SaveSmartAttributes indicates an expected call of SaveSmartAttributes.
|
|
func (mr *MockDeviceRepoMockRecorder) SaveSmartAttributes(ctx, scrutiny_uuid, collectorSmartData any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSmartAttributes", reflect.TypeOf((*MockDeviceRepo)(nil).SaveSmartAttributes), ctx, scrutiny_uuid, collectorSmartData)
|
|
}
|
|
|
|
// SaveSmartTemperature mocks base method.
|
|
func (m *MockDeviceRepo) SaveSmartTemperature(ctx context.Context, scrutiny_uuid uuid.UUID, deviceProtocol string, collectorSmartData collector.SmartInfo, discardSCTTempHistory bool) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SaveSmartTemperature", ctx, scrutiny_uuid, deviceProtocol, collectorSmartData, discardSCTTempHistory)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// SaveSmartTemperature indicates an expected call of SaveSmartTemperature.
|
|
func (mr *MockDeviceRepoMockRecorder) SaveSmartTemperature(ctx, scrutiny_uuid, deviceProtocol, collectorSmartData, discardSCTTempHistory any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSmartTemperature", reflect.TypeOf((*MockDeviceRepo)(nil).SaveSmartTemperature), ctx, scrutiny_uuid, deviceProtocol, collectorSmartData, discardSCTTempHistory)
|
|
}
|
|
|
|
// UpdateDevice mocks base method.
|
|
func (m *MockDeviceRepo) UpdateDevice(ctx context.Context, scrutiny_uuid uuid.UUID, collectorSmartData collector.SmartInfo) (models.Device, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "UpdateDevice", ctx, scrutiny_uuid, collectorSmartData)
|
|
ret0, _ := ret[0].(models.Device)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// UpdateDevice indicates an expected call of UpdateDevice.
|
|
func (mr *MockDeviceRepoMockRecorder) UpdateDevice(ctx, scrutiny_uuid, collectorSmartData any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDevice", reflect.TypeOf((*MockDeviceRepo)(nil).UpdateDevice), ctx, scrutiny_uuid, collectorSmartData)
|
|
}
|
|
|
|
// UpdateDeviceArchived mocks base method.
|
|
func (m *MockDeviceRepo) UpdateDeviceArchived(ctx context.Context, scrutiny_uuid uuid.UUID, archived bool) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "UpdateDeviceArchived", ctx, scrutiny_uuid, archived)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// UpdateDeviceArchived indicates an expected call of UpdateDeviceArchived.
|
|
func (mr *MockDeviceRepoMockRecorder) UpdateDeviceArchived(ctx, scrutiny_uuid, archived any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDeviceArchived", reflect.TypeOf((*MockDeviceRepo)(nil).UpdateDeviceArchived), ctx, scrutiny_uuid, archived)
|
|
}
|
|
|
|
// UpdateDeviceStatus mocks base method.
|
|
func (m *MockDeviceRepo) UpdateDeviceStatus(ctx context.Context, scrutiny_uuid uuid.UUID, status pkg.DeviceStatus) (models.Device, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "UpdateDeviceStatus", ctx, scrutiny_uuid, status)
|
|
ret0, _ := ret[0].(models.Device)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// UpdateDeviceStatus indicates an expected call of UpdateDeviceStatus.
|
|
func (mr *MockDeviceRepoMockRecorder) UpdateDeviceStatus(ctx, scrutiny_uuid, status any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDeviceStatus", reflect.TypeOf((*MockDeviceRepo)(nil).UpdateDeviceStatus), ctx, scrutiny_uuid, status)
|
|
}
|