service

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: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateInProgress = "In progress"
	StateFinished   = "Finished"
	StateError      = "Error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceService

type DeviceService interface {
	GetAll(ctx context.Context, userID int) (interface{}, error)
	GetById(ctx context.Context, ID, userID int) (interface{}, error)
	Add(ctx context.Context, model interface{}, userID int) error
	Update(ctx context.Context, model interface{}, userID int) error
	Delete(ctx context.Context, deviceID, userID int) (interface{}, error)
	GenerateDeviceCfg(ctx context.Context, deviceID, userID int, binaryOS string) (string, error)
}

func NewDeviceService

func NewDeviceService() DeviceService

type MeasurementService

type MeasurementService interface {
	Monitor(ctx context.Context, email string, userID int, monitorDto dto.MonitorDto) (<-chan bool, error)
	GetMonitorStatus(deviceID, userID int) dto.MonitorStatus
	GetSensorsCorrelationCoefficient(ctx context.Context, deviceID1, deviceID2, sensorID1, sensorID2, startTime, endTime string, userID int) (float64, error)
	GetAverageValueOfMeasurements(ctx context.Context, deviceID, sensorID, startTime, endTime string, userID int) (string, error)
	GetMeasurementsBetweenTimestamp(ctx context.Context, startTime, endTime, sensorID, deviceID string, userID int) ([]dto.Measurement, error)
	AddMeasurements(ctx context.Context, measurement dto.Measurement) error
}

func NewMeasurementService

func NewMeasurementService() MeasurementService

type SensorService

type SensorService interface {
	GetAll(ctx context.Context) ([]dto.Sensor, error)
	GetById(ctx context.Context, ID int) (dto.Sensor, error)
	Update(ctx context.Context, model interface{}) error
}

func NewSensorService

func NewSensorService() SensorService

type UserService

type UserService interface {
	Register(ctx context.Context, registerDto dto.Register) error
	Login(ctx context.Context, loginDto dto.Login) (string, error)
	AddDevice(ctx context.Context, userID int) error
}

func NewUserService

func NewUserService() UserService

Jump to

Keyboard shortcuts

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