Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIPNotFound = errors.New("local ip not found") ErrIFacesNotFound = errors.New("cant get interfaces") ErrIFacesAddressNotFound = errors.New("cant get interfaces address") ErrHostnameNotFound = errors.New("cant get hostname") ErrCannotGetAppURL = errors.New("cannot get app url") ErrIDNotFound = errors.New("entity id not found") ErrIDAlreadyExists = errors.New("entity id already exists") ErrEntityNotFound = errors.New("entity not found") ErrSensorNotFound = errors.New("sensor not found") ErrImageNotFound = errors.New("image not found") ErrFlowerbedNotFound = errors.New("flowerbed not found") ErrTreeClusterNotFound = errors.New("treecluster not found") ErrRegionNotFound = errors.New("region not found") ErrTreeNotFound = errors.New("tree not found") ErrUnknowError = errors.New("unknown error") ErrToManyRows = errors.New("receive more rows then expected") ErrConnectionClosed = errors.New("connection is closed") ErrTxClosed = errors.New("transaction closed") ErrTxCommitRollback = errors.New("transaction cannot commit or rollback") )
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
type AuthRepository interface { RetrospectToken(ctx context.Context, token string) (*entities.IntroSpectTokenResult, error) GetAccessTokenFromClientCode(ctx context.Context, code, redirectURL string) (*entities.ClientToken, error) RefreshToken(ctx context.Context, refreshToken string) (*entities.ClientToken, error) }
type BasicCrudRepository ¶
type BasicCrudRepository[T entities.Entities] interface { GetAll(ctx context.Context) ([]*T, error) GetByID(ctx context.Context, id int32) (*T, error) Create(ctx context.Context, fn ...entities.EntityFunc[T]) (*T, error) Update(ctx context.Context, id int32, fn ...entities.EntityFunc[T]) (*T, error) Delete(ctx context.Context, id int32) error }
type FlowerbedRepository ¶
type FlowerbedRepository interface { BasicCrudRepository[entities.Flowerbed] GetSensorByFlowerbedID(ctx context.Context, id int32) (*entities.Sensor, error) GetAllImagesByID(ctx context.Context, id int32) ([]*entities.Image, error) CreateAndLinkImages(ctx context.Context, fFn ...entities.EntityFunc[entities.Flowerbed]) (*entities.Flowerbed, error) UpdateWithImages(ctx context.Context, id int32, fFn ...entities.EntityFunc[entities.Flowerbed]) (*entities.Flowerbed, error) DeleteAndUnlinkImages(ctx context.Context, id int32) error UnlinkAllImages(ctx context.Context, id int32) error UnlinkImage(ctx context.Context, flowerbedID, imageID int32) error Archive(ctx context.Context, id int32) error }
type ImageRepository ¶
type ImageRepository interface { BasicCrudRepository[entities.Image] }
type InfoRepository ¶
type RegionRepository ¶
type Repository ¶
type Repository struct { Auth AuthRepository Info InfoRepository Sensor SensorRepository Tree TreeRepository User UserRepository Role RoleRepository Image ImageRepository Vehicle VehicleRepository TreeCluster TreeClusterRepository Flowerbed FlowerbedRepository Region RegionRepository }
type RoleRepository ¶
type SensorRepository ¶
type SensorRepository interface { BasicCrudRepository[entities.Sensor] GetStatusByID(ctx context.Context, id int32) (*entities.SensorStatus, error) GetSensorByStatus(ctx context.Context, status *entities.SensorStatus) ([]*entities.Sensor, error) GetSensorDataByID(ctx context.Context, id int32) ([]*entities.SensorData, error) InsertSensorData(ctx context.Context, data []*entities.SensorData) ([]*entities.SensorData, error) }
type TreeClusterRepository ¶
type TreeClusterRepository interface { BasicCrudRepository[entities.TreeCluster] GetSensorByTreeClusterID(ctx context.Context, id int32) (*entities.Sensor, error) Archive(ctx context.Context, id int32) error LinkTreesToCluster(ctx context.Context, treeClusterID int32, treeIDs []int32) error GetByAddress(ctx context.Context, address string) (*entities.TreeCluster, error) }
type TreeRepository ¶
type TreeRepository interface { BasicCrudRepository[entities.Tree] GetByTreeClusterID(ctx context.Context, id int32) ([]*entities.Tree, error) GetAllImagesByID(ctx context.Context, id int32) ([]*entities.Image, error) GetSensorByTreeID(ctx context.Context, id int32) (*entities.Sensor, error) GetTreesByIDs(ctx context.Context, ids []int32) ([]*entities.Tree, error) GetByCoordinates(ctx context.Context, latitude, longitude float64) (*entities.Tree, error) UpdateWithImages(ctx context.Context, id int32, fFn ...entities.EntityFunc[entities.Tree]) (*entities.Tree, error) DeleteAndUnlinkImages(ctx context.Context, id int32) error UnlinkAllImages(ctx context.Context, id int32) error UnlinkTreeClusterID(ctx context.Context, treeClusterID int32) error UnlinkImage(ctx context.Context, flowerbedID, imageID int32) error CreateAndLinkImages(ctx context.Context, tcFn ...entities.EntityFunc[entities.Tree]) (*entities.Tree, error) GetCenterPoint(ctx context.Context, id []int32) (float64, float64, error) }
type UserRepository ¶
Click to show internal directories.
Click to hide internal directories.