Documentation
¶
Index ¶
- Constants
- Variables
- type AssetTag
- type Business
- func (b *Business) Count(ctx context.Context, filter QueryFilter) (int, error)
- func (b *Business) Create(ctx context.Context, nat NewAssetTag) (AssetTag, error)
- func (b *Business) Delete(ctx context.Context, at AssetTag) 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) ([]AssetTag, error)
- func (b *Business) QueryByID(ctx context.Context, id uuid.UUID) (AssetTag, error)
- func (b *Business) Update(ctx context.Context, at AssetTag, uat UpdateAssetTag) (AssetTag, error)
- type NewAssetTag
- type QueryFilter
- type Storer
- type UpdateAssetTag
Constants ¶
View Source
const ( OrderByID = "asset_tag_id" OrderByAssetID = "asset_id" OrderByTagID = "tag_id" )
Variables ¶
View Source
var ( ErrNotFound = errors.New("asset tag not found") ErrAuthenticationFailure = errors.New("authentication failure") ErrUniqueEntry = errors.New("asset tag entry is not unique") )
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type Business ¶
type Business struct {
// contains filtered or unexported fields
}
Business manages the set of APIs for tag access.
func NewBusiness ¶
NewBusiness constructs an asset tag 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) ([]AssetTag, error)
Query retrieves a list of existing asset tags from the system.
type NewAssetTag ¶
func TestNewAssetTag ¶
func TestNewAssetTag(n int, assetIDs, tagIDs []uuid.UUID) []NewAssetTag
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, tag AssetTag) error Update(ctx context.Context, tag AssetTag) error Delete(ctx context.Context, tag AssetTag) error Query(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page) ([]AssetTag, error) Count(ctx context.Context, filter QueryFilter) (int, error) QueryByID(ctx context.Context, tagID uuid.UUID) (AssetTag, error) }
Storer interface declares the behavior this package needs to persist and retrieve data.
Click to show internal directories.
Click to hide internal directories.