repository

package
v0.0.0-...-055cc3d Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert interface {
	GetAll() ([]model.Alert, error)
	GetByUserID(userID uint) ([]model.Alert, error)
	GetByUserIDAndID(userID, id uint) (model.Alert, error)
	Create(alert model.Alert) (model.Alert, error)
	Save(alert model.Alert) (model.Alert, error)
	DeleteByID(id uint) error
}

type Device

type Device interface {
	GetAll() ([]model.Device, error)
	GetByID(id uint) (model.Device, error)
	GetByToken(token string) (model.Device, error)
	Create(device model.Device) (model.Device, error)
	Save(device model.Device) (model.Device, error)
	DeleteByID(id uint) error
}

type Ownership

type Ownership interface {
	FindByUserID(userID uint) ([]model.Ownership, error)
	FindByDeviceID(deviceID uint) ([]*model.Ownership, error)
	Find(userID uint, deviceID uint) (model.Ownership, error)
	Create(userID uint, deviceID uint, role model.OwnershipRole) (model.Ownership, error)
	Exists(userID uint, deviceID uint) (bool, error)
	Delete(userID uint, deviceID uint) error
}

type Phone

type Phone interface {
	List(userID uint) ([]model.Phone, error)
	GetByUserIDAndPushID(userID uint, pushID string) (model.Phone, error)
	Update(phone model.Phone) (model.Phone, error)
	Create(phone model.Phone) (model.Phone, error)
	Delete(phone model.Phone) error
}

type Reading

type Reading interface {
	List(deviceID uint, start, end time.Time) ([]model.Reading, error)
	Create(reading model.Reading) (model.Reading, error)
}

type Repositories

type Repositories interface {
	User() User
	Ownership() Ownership
	Device() Device
	Reading() Reading
	Alert() Alert
	Phone() Phone
}

func NewRepositories

func NewRepositories(db *gorm.DB) Repositories

type User

type User interface {
	Save(user model.User) (model.User, error)
	FindByID(id uint) (model.User, error)
	FindByEmail(email string) (model.User, error)
}

Jump to

Keyboard shortcuts

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