repository

package
v0.0.0-...-8fa7ef6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemRepository

type ItemRepository interface {
	CreateItem(ctx context.Context, item *api.Item) (*api.Item, error)
	GetItem(ctx context.Context, id string) (*api.Item, error)
	ListItems(ctx context.Context) ([]*api.Item, error)
	UpdateItem(ctx context.Context, item *api.Item) (*api.Item, error)
	DeleteItem(ctx context.Context, id string) error
}

func NewItemRepository

func NewItemRepository(db Store, itemQuery query.ItemQuery) ItemRepository

type OrderRepository

type OrderRepository interface {
	CreateOrder(ctx context.Context, order *api.Order) (*api.Order, error)
	GetOrder(ctx context.Context, id string) (*api.Order, error)
	ListOrders(ctx context.Context) ([]*api.Order, error)
	UpdateOrder(ctx context.Context, order *api.Order) (*api.Order, error)
	DeleteOrder(ctx context.Context, id string) error
}

func NewOrderRepository

func NewOrderRepository(db Store, orderQuery query.OrderQuery) OrderRepository

type Store

type Store interface {
	WithTx(ctx context.Context, fn func(tx pgx.Tx) error) error
	WithoutTx(ctx context.Context, fn func(ctx context.Context) error) error
}

func NewStore

func NewStore(db *pgxpool.Pool, config config.DBConfig) Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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