Documentation ¶
Overview ¶
Package service - слой бизнес-логики
Index ¶
- type PackageService
- func (p *PackageService) Create(ctx context.Context, pkg model.Package) (*uint64, error)
- func (p *PackageService) Delete(ctx context.Context, id uint64) error
- func (p *PackageService) Get(ctx context.Context, id uint64) (*model.Package, error)
- func (p *PackageService) List(ctx context.Context, offset uint64, limit uint64) ([]model.Package, error)
- func (p *PackageService) Update(ctx context.Context, pkg model.Package) error
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PackageService ¶
type PackageService struct {
// contains filtered or unexported fields
}
PackageService is service for Package
func NewPackageService ¶
func NewPackageService(dbpool *pgxpool.Pool, repo Repo) *PackageService
NewPackageService - конструктор
func (*PackageService) Delete ¶
func (p *PackageService) Delete(ctx context.Context, id uint64) error
Delete - удаление пакета
type Repo ¶
type Repo interface { Create(ctx context.Context, pkg model.Package) (*uint64, error) Delete(ctx context.Context, id uint64) error Get(ctx context.Context, id uint64) (*model.Package, error) List(ctx context.Context, offset uint64, limit uint64) ([]model.Package, error) Update(ctx context.Context, pkg model.Package) error }
Repo interface for work with database
Click to show internal directories.
Click to hide internal directories.