repository

package
v0.0.0-...-3da7291 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL