Documentation ¶
Overview ¶
Package productdb contains product related CRUD functionality.
Index ¶
- type Store
- func (s *Store) Count(ctx context.Context, filter productbus.QueryFilter) (int, error)
- func (s *Store) Create(ctx context.Context, prd productbus.Product) error
- func (s *Store) Delete(ctx context.Context, prd productbus.Product) error
- func (s *Store) NewWithTx(tx sqldb.CommitRollbacker) (productbus.Storer, error)
- func (s *Store) Query(ctx context.Context, filter productbus.QueryFilter, orderBy order.By, ...) ([]productbus.Product, error)
- func (s *Store) QueryByID(ctx context.Context, productID uuid.UUID) (productbus.Product, error)
- func (s *Store) QueryByUserID(ctx context.Context, userID uuid.UUID) ([]productbus.Product, error)
- func (s *Store) Update(ctx context.Context, prd productbus.Product) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages the set of APIs for product database access.
func (*Store) Count ¶
func (s *Store) Count(ctx context.Context, filter productbus.QueryFilter) (int, error)
Count returns the total number of users in the DB.
func (*Store) Create ¶
Create adds a Product to the sqldb. It returns the created Product with fields like ID and DateCreated populated.
func (*Store) NewWithTx ¶
func (s *Store) NewWithTx(tx sqldb.CommitRollbacker) (productbus.Storer, error)
NewWithTx constructs a new Store value replacing the sqlx DB value with a sqlx DB value that is currently inside a transaction.
func (*Store) Query ¶
func (s *Store) Query(ctx context.Context, filter productbus.QueryFilter, orderBy order.By, page page.Page) ([]productbus.Product, error)
Query gets all Products from the database.
func (*Store) QueryByUserID ¶
QueryByUserID finds the product identified by a given User ID.
Click to show internal directories.
Click to hide internal directories.