items

package
v0.0.0-...-ac3ec41 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package items implements application business logic. Each logic group in own file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUDItems

type CRUDItems interface {
	List(ctx context.Context) ([]byte, error)
	Create(ctx context.Context, campaignId int, name string) (entity.Item, error)
	Update(ctx context.Context, u entity.UpdateData) (entity.Item, error)
	Delete(ctx context.Context, id int) error
}

CRUDItems интерфейс CRUD для Itms

type Items

type Items struct {
	// contains filtered or unexported fields
}

Service Items provide access items in database

func New

func New(r ItemsRepo, redis *redis.Client, nc *nats.Conn) *Items

Items constructor

func (*Items) Create

func (it *Items) Create(ctx context.Context, campaignId int, name string) (entity.Item, error)

func (*Items) Delete

func (it *Items) Delete(ctx context.Context, id int) error

func (*Items) List

func (it *Items) List(ctx context.Context) ([]byte, error)

Implementation of CRUDItems interface

func (*Items) Update

func (it *Items) Update(ctx context.Context, u entity.UpdateData) (entity.Item, error)

type ItemsRepo

type ItemsRepo interface {
	Create(ctx context.Context, item *entity.Item) error
	Update(ctx context.Context, u entity.UpdateData) (entity.Item, error)
	Delete(ctx context.Context, id int) (entity.Item, error)
	List(ctx context.Context) ([]entity.Item, error)
	MaxPriority(ctx context.Context) (int, error)
}

ItemsRepo репозиторий для items

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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