ports

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketService

type BucketService interface {
	GetByControl(id uint64) ([]domain.Bucket, error)
	Get(id uint64) (*domain.Bucket, error)
	Add(bucket *domain.Bucket) *domain.Bucket
	Update(id uint64, bucket domain.Bucket) domain.Bucket
	Remove(id uint64)
}

type BucketStorage

type BucketStorage interface {
	Storage[domain.Bucket, uint64]
	GetByControlId(id uint64) ([]domain.Bucket, error)
	GetAll() []domain.Bucket
}

type ControlService

type ControlService interface {
	LogIn(login, password string) (domain.Control, error)
	Reg(login, password, role string) (domain.Control, error)
}

type ControlStorage

type ControlStorage interface {
	Auth(login, pass string) (domain.Control, error)
	Registration(control *domain.Control) (domain.Control, error)
}

type DataService

type DataService interface {
	Find(ctx context.Context, data *dto.DataSelect) ([]domain.Data, error)
	Write(ctx context.Context, data *domain.Data) error
	Clear()
	Shutdown()
	Count(ctx context.Context, bucketId uint64) (int64, error)
	CountAll(ctx context.Context) (map[uint64]int64, error)
	Subscribe() (<-chan domain.Data, uint64)
	Unsubscribe(id uint64)
}

type DataStorage

type DataStorage interface {
	Add([]domain.Data) error
	Clear(bucketId uint64, of time.Time)
	Select(bucketId uint64, from, to time.Time) []domain.Data
	Create(bucketId uint64)
	Find(data *dto.DataSelect) []domain.Data
	Count(bucketId uint64) (int64, error)
	CountAll() (map[uint64]int64, error)
}

type PointService

type PointService interface {
	GetByExternal(controlId uint64, extId string) domain.Point
	GetByExternalId(backetId uint64, extId string) domain.Point
	GetByExternalIds(backetId uint64, extId []string) []domain.Point
	GetByBacketId(controlId uint64, backetId uint64) []domain.Point
	Remove(controlId uint64, pointId uint64)
	Update(point domain.Point) domain.Point
	Add(controlId uint64, point domain.Point) domain.Point
}

type PointStorage

type PointStorage interface {
	Storage[domain.Point, uint64]
	GetByBacketId(id uint64) []domain.Point
	GetByExternalId(ids []uint64, ext string) *domain.Point
	GetByExternalIds(bucketId uint64, ext []string) []domain.Point
}

type StatusService added in v0.1.13

type StatusService interface {
	Status(ctx context.Context) (map[string]any, error)
	Metrics(ctx context.Context) (map[string]any, error)
}

type Storage

type Storage[T any, I any] interface {
	Add(t T) T
	GetById(id I) (T, error)
	Update(id I, t T) T
	Remove(id I)
}

type TokenService

type TokenService interface {
	GetByToken(token string) (map[string]any, error)
	Add(controlId uint64, token domain.Token) domain.Token
	GetByBucketId(controlId uint64, id uint64) []domain.Token
	Remove(controlId uint64, id uint64)
}

type TokenStorage

type TokenStorage interface {
	Storage[domain.Token, uint64]
	GetByToken(string) (domain.Token, error)
	GetByBucketId(id uint64) []domain.Token
}

Jump to

Keyboard shortcuts

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