Documentation
¶
Index ¶
- Constants
- Variables
- type Business
- func (b *Business) Count(ctx context.Context, filter QueryFilter) (int, error)
- func (b *Business) Create(ctx context.Context, nt NewTitle) (Title, error)
- func (b *Business) Delete(ctx context.Context, fs Title) error
- func (b *Business) NewWithTx(tx sqldb.CommitRollbacker) (*Business, error)
- func (b *Business) Query(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page) ([]Title, error)
- func (b *Business) QueryByID(ctx context.Context, titleStatusID uuid.UUID) (Title, error)
- func (b *Business) Update(ctx context.Context, fs Title, ut UpdateTitle) (Title, error)
- type NewTitle
- type QueryFilter
- type Storer
- type Title
- type UpdateTitle
Constants ¶
View Source
const ( OrderByID = "title_id" OrderByName = "name" OrderByDescription = "description" )
Variables ¶
View Source
var ( ErrNotFound = errors.New("title not found") ErrAuthenticationFailure = errors.New("authentication failed") ErrUniqueEntry = errors.New("title entry is not unique") )
Set of error variables for CRUD operations.
View Source
var DefaultOrderBy = order.NewBy(OrderByName, order.ASC)
Functions ¶
This section is empty.
Types ¶
type Business ¶
type Business struct {
// contains filtered or unexported fields
}
func NewBusiness ¶
NewBusiness constructs a new title business API for use.
func (*Business) NewWithTx ¶
func (b *Business) NewWithTx(tx sqldb.CommitRollbacker) (*Business, error)
NewWithTx constructs a new business value that will use the specified transaction in any store related calls.
func (*Business) Query ¶
func (b *Business) Query(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page) ([]Title, error)
Query returns a list of titles
type NewTitle ¶
func TestNewTitle ¶
type QueryFilter ¶
QueryFilter holds the available fields a query can be filtered on. We are using pointer semantics because the With API mutates the value.
type Storer ¶
type Storer interface { NewWithTx(tx sqldb.CommitRollbacker) (Storer, error) Create(ctx context.Context, title Title) error Update(ctx context.Context, title Title) error Delete(ctx context.Context, title Title) error Query(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page) ([]Title, error) Count(ctx context.Context, filter QueryFilter) (int, error) QueryByID(ctx context.Context, titleID uuid.UUID) (Title, error) }
Storer interface declares the behavior this package needs to persist and retrieve data.
type UpdateTitle ¶
Click to show internal directories.
Click to hide internal directories.