Documentation ¶
Overview ¶
Package db contains tag related CRUD functionality.
Index ¶
- type Store
- func (s Store) Create(ctx context.Context, tag Tag) error
- func (s Store) Delete(ctx context.Context, tagID string) error
- func (s Store) QueryByID(ctx context.Context, tagID string) (Tag, error)
- func (s Store) QueryWorkspaceTags(ctx context.Context, workspaceID string, pageNumber, rowsPerPage int) ([]Tag, error)
- func (s Store) Tran(tx sqlx.ExtContext) Store
- func (s Store) Update(ctx context.Context, tag Tag) error
- func (s Store) WithinTran(ctx context.Context, fn func(sqlx.ExtContext) error) error
- type Tag
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 user access.
func NewStore ¶
func NewStore(log *zap.SugaredLogger, db *sqlx.DB) Store
NewStore constructs a data for api access.
func (Store) QueryWorkspaceTags ¶
func (s Store) QueryWorkspaceTags(ctx context.Context, workspaceID string, pageNumber, rowsPerPage int) ([]Tag, error)
QueryWorkspaceTags retrieves a list of existing tag from the database.
func (Store) Tran ¶
func (s Store) Tran(tx sqlx.ExtContext) Store
Tran return new Store with transaction in it.
func (Store) WithinTran ¶
WithinTran runs passed function and do commit/rollback at the end.
Click to show internal directories.
Click to hide internal directories.