Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceRepository ¶
type DeviceRepository interface {
GetDeviceNameByID(ctx context.Context, id, userID int) (string, error)
GetDeviceIDByName(ctx context.Context, deviceName string, userID int) (int32, error)
AddDeviceSensors(ctx context.Context, deviceID, sensorID int32) error
GetAll(ctx context.Context, userID int) (interface{}, error)
GetByID(ctx context.Context, id, userID int) (interface{}, error)
Add(ctx context.Context, entity interface{}, userID int) error
Update(ctx context.Context, entity interface{}, userID int) error
Delete(ctx context.Context, id, userID int) error
}
func NewDeviceRepository ¶
func NewDeviceRepository() DeviceRepository
type MeasurementRepository ¶
type MeasurementRepository interface {
Add(ctx context.Context, measuerement entity.Measurement) error
GetMeasurementsFromStartingTime(ctx context.Context, startTime string, userID int) ([]interface{}, error)
GetMeasurementsBetweenTimestampByDeviceIDBySensorID(ctx context.Context, startTime, endTime, deviceID, sensorID string, userID int) ([]interface{}, error)
GetMeasurementsValuesBetweenTimestampByDeviceIDAndSensorID(ctx context.Context, startTime, endTime, deviceID, sensorID string, userID int) ([]interface{}, error)
GetMeasurementsAverageValueBetweenTimestampByDeviceIDAndSensorID(ctx context.Context, startTime, endTime, deviceID, sensorID string, userID int) (string, error)
CountMeasurementsBetweenTimestampByDeviceIDBySensorID(ctx context.Context, startTime, endTime, deviceID, sensorID string, userID int) (float64, error)
}
func NewMeasurementRepository ¶
func NewMeasurementRepository() MeasurementRepository
type SensorRepository ¶
type SensorRepository interface {
GetSensorIDByName(ctx context.Context, name string) (string, error)
GetSensorGroupByName(ctx context.Context, sensorGroup string) (string, error)
GetSensorByDeviceID(ctx context.Context, deviceID string) ([]entity.Sensor, error)
GetAll(ctx context.Context) (interface{}, error)
GetByID(ctx context.Context, sensorID int) (interface{}, error)
Update(ctx context.Context, entity interface{}) error
}
func NewSensorRepository ¶
func NewSensorRepository() SensorRepository
type UserRepository ¶
type UserRepository interface {
AddUser(ctx context.Context, userEntity entity.User) error
AddUserDvice(ctx context.Context, userID int) error
GetUserByUsername(ctx context.Context, username string) (entity.User, error)
GetUserIDByUsername(ctx context.Context, name string) (int, error)
GetUserIDByEmail(ctx context.Context, email string) (int, error)
}
func NewUserRepository ¶
func NewUserRepository() UserRepository
Click to show internal directories.
Click to hide internal directories.