pickpoint

package
v0.0.0-...-eda81a1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func New

func New(storage Storage, tm Manager) *Controller

func (*Controller) Create

func (c *Controller) Create(ctx context.Context, object model.PickPoint) (string, error)

func (*Controller) Delete

func (c *Controller) Delete(ctx context.Context, id string) error

func (*Controller) GetByID

func (c *Controller) GetByID(ctx context.Context, id string) (model.PickPoint, error)

func (*Controller) List

func (c *Controller) List(ctx context.Context) ([]model.PickPoint, error)

func (*Controller) Update

func (c *Controller) Update(ctx context.Context, object model.PickPoint) (string, error)

type Manager

type Manager interface {
	// Do processes a transaction inside a closure.
	Do(context.Context, func(ctx context.Context) error) error
	// DoWithSettings processes a transaction inside a closure with custom trm.Settings.
	DoWithSettings(context.Context, trm.Settings, func(ctx context.Context) error) error
}

type Storage

type Storage interface {
	GetByID(ctx context.Context, id pgtype.UUID) (repository.PickPointDTO, error)
	List(ctx context.Context) ([]repository.PickPointDTO, error)
	Create(ctx context.Context, dto repository.PickPointDTO) (pgtype.UUID, error)
	Delete(ctx context.Context, id pgtype.UUID) error
	Update(ctx context.Context, dto repository.PickPointDTO) (pgtype.UUID, error)
}

Jump to

Keyboard shortcuts

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