repository

package
v0.0.0-...-072db41 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type AquahubListPostgres

type AquahubListPostgres struct {
	// contains filtered or unexported fields
}

func NewAquahubListPostgres

func NewAquahubListPostgres(log *logrus.Logger, db *sqlx.DB) *AquahubListPostgres

func (*AquahubListPostgres) AppendData_OfSensor

func (r *AquahubListPostgres) AppendData_OfSensor(list []domain.SensorDataSet) error

func (*AquahubListPostgres) Device_CreateOrUpdate

func (r *AquahubListPostgres) Device_CreateOrUpdate(aquahub_id int, device_local_id int, value string) error

func (*AquahubListPostgres) GetAquahubs_OfUser

func (r *AquahubListPostgres) GetAquahubs_OfUser(userId int) ([]domain.AquahubList, error)

func (*AquahubListPostgres) GetDataSet_OfSensor

func (r *AquahubListPostgres) GetDataSet_OfSensor(sensorId int) ([]domain.SensorDataSet, error)

func (*AquahubListPostgres) GetDevices_OfAquahub

func (r *AquahubListPostgres) GetDevices_OfAquahub(aquahubId int) ([]domain.AquahubList, error)

func (*AquahubListPostgres) GetName_DeviceSensor

func (r *AquahubListPostgres) GetName_DeviceSensor(sensor_id int) (domain.NameOfDeviceSensor, error)

func (*AquahubListPostgres) GetSensors_OfDevice

func (r *AquahubListPostgres) GetSensors_OfDevice(deviceId int) ([]domain.AquahubList, error)

func (*AquahubListPostgres) Sensor_CreateOrUpdate

func (r *AquahubListPostgres) Sensor_CreateOrUpdate(aquahub_id, device_local_id, sensor_local_id int, value string) error

type AuthPostgres

type AuthPostgres struct {
	// contains filtered or unexported fields
}

func NewAuthPostgres

func NewAuthPostgres(db *sqlx.DB) *AuthPostgres

func (*AuthPostgres) CreateUser

func (r *AuthPostgres) CreateUser(user domain.User) (int, error)

Принимает структуру User в качестве аргумента Возвращает ID созданного нового пользователя из БД

func (*AuthPostgres) GetAquahubId_fromTokens

func (r *AuthPostgres) GetAquahubId_fromTokens(h_token, u_token string) (int, error)

Запросить по токенам ID аквахаба

func (*AuthPostgres) GetUserByEmail

func (r *AuthPostgres) GetUserByEmail(email string) (*domain.User, error)

gets a unique user by email from the database.

func (*AuthPostgres) GetUserHW_fromTokens

func (r *AuthPostgres) GetUserHW_fromTokens(h_token, u_token string) ([]domain.SensorDataSet, error)

Запросить по токену список связку:

ID_шников пользователя, аквахаба, устройств, сенсоров БД
с локальными ID_шниками устройств и сенсоров

user_id & aquahub_id & device_id & sensor_id <===> local_device_id & local_sensor_id

func (*AuthPostgres) GetUser_LoginPassword

func (r *AuthPostgres) GetUser_LoginPassword(email, password string) (domain.User, error)

Запросить в БД пользователя

type ChecklistItemPostgres

type ChecklistItemPostgres struct {
	// contains filtered or unexported fields
}

func NewChecklistItemPostgres

func NewChecklistItemPostgres(db *sqlx.DB) *ChecklistItemPostgres

func (*ChecklistItemPostgres) Create

func (r *ChecklistItemPostgres) Create(listId int, item domain.ChecklistItem) (int, error)

func (*ChecklistItemPostgres) Delete

func (r *ChecklistItemPostgres) Delete(userId, listId, itemId int) error

func (*ChecklistItemPostgres) GetAll

func (r *ChecklistItemPostgres) GetAll(userId, listId int) ([]domain.ChecklistItem, error)

func (*ChecklistItemPostgres) GetById

func (r *ChecklistItemPostgres) GetById(userId, listId, itemId int) (domain.ChecklistItem, error)

func (*ChecklistItemPostgres) Update

func (r *ChecklistItemPostgres) Update(userId, listId, itemId int, input domain.UpdateChecklistItem) error

type ChecklistPostgres

type ChecklistPostgres struct {
	// contains filtered or unexported fields
}

func NewChecklistPostgres

func NewChecklistPostgres(log *logrus.Logger, db *sqlx.DB) *ChecklistPostgres

func (*ChecklistPostgres) Create

func (r *ChecklistPostgres) Create(userId int, list domain.CreateChecklist) (int, error)

func (*ChecklistPostgres) Delete

func (r *ChecklistPostgres) Delete(userId, listId int) error

func (*ChecklistPostgres) GetAll_ChecklistOfUser

func (r *ChecklistPostgres) GetAll_ChecklistOfUser(userId int) ([]domain.Checklist, error)

func (*ChecklistPostgres) GetById

func (r *ChecklistPostgres) GetById(userId, listId int) (*domain.Checklist, error)

func (*ChecklistPostgres) Update

func (r *ChecklistPostgres) Update(userId int, input domain.UpdateChecklist) error

Jump to

Keyboard shortcuts

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