service

package
v0.0.0-...-1e03f0b Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package service - слой бизнес-логики

Index

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) Create

func (p *PackageService) Create(ctx context.Context, pkg model.Package) (*uint64, error)

Create - создание нового пакета

func (*PackageService) Delete

func (p *PackageService) Delete(ctx context.Context, id uint64) error

Delete - удаление пакета

func (*PackageService) Get

func (p *PackageService) Get(ctx context.Context, id uint64) (*model.Package, error)

Get - получение пакета

func (*PackageService) List

func (p *PackageService) List(ctx context.Context, offset uint64, limit uint64) ([]model.Package, error)

List - получение списка пакетов

func (*PackageService) Update

func (p *PackageService) Update(ctx context.Context, pkg model.Package) error

Update - изменение пакета

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

Jump to

Keyboard shortcuts

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