service

package
v0.0.0-...-3910e7f Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter = db.CurrencyFilter

type Item

type Item = db.Currency

type Repository

type Repository interface {
	Get(ctx context.Context, filter *Filter) (*Item, error)
	GetDefault() *Item
	List(ctx context.Context, filter *Filter) (*map[uuid.UUID]Item, error)
	Create(ctx context.Context, item *Item) (*uuid.UUID, error)
	Update(ctx context.Context, item *Item) error
	Patch(ctx context.Context, id *uuid.UUID, fields *map[string]interface{}) error
	UpdatedAt(ctx context.Context, id *uuid.UUID) (*time.Time, error)
	TableIndexCount(ctx context.Context) (*uint64, error)
	MaxSortOrder(ctx context.Context) (*uint64, error)
	Delete(ctx context.Context, id *uuid.UUID) error
}

type Service

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

func NewService

func NewService(repository *model.Model, store *db.Store) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, item *Item) (*uuid.UUID, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id *uuid.UUID) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, filter *Filter) (*Item, error)

func (*Service) GetDefault

func (s *Service) GetDefault() *Item

func (*Service) List

func (s *Service) List(ctx context.Context, filter *Filter) (*map[uuid.UUID]Item, error)

func (*Service) MaxSortOrder

func (s *Service) MaxSortOrder(ctx context.Context) (*uint64, error)

func (*Service) Patch

func (s *Service) Patch(ctx context.Context, id *uuid.UUID, fields *map[string]interface{}) error

func (*Service) TableIndexCount

func (s *Service) TableIndexCount(ctx context.Context) (*uint64, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, item *Item) error

func (*Service) UpdatedAt

func (s *Service) UpdatedAt(ctx context.Context, id *uuid.UUID) (*time.Time, error)

Jump to

Keyboard shortcuts

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