Documentation ¶
Index ¶
- Variables
- type Core
- func (c Core) Create(ctx context.Context, nt NewTag, now time.Time) (Tag, error)
- func (c Core) Delete(ctx context.Context, tagID string) error
- func (c Core) QueryByID(ctx context.Context, tagID string) (Tag, error)
- func (c Core) QueryWorkspaceTags(ctx context.Context, workspaceID string, pageNumber, rowsPerPage int) ([]Tag, error)
- func (c Core) Update(ctx context.Context, tagID string, ut UpdateTag, now time.Time) error
- type NewTag
- type Tag
- type UpdateTag
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("tag not found") ErrInvalidID = errors.New("ID is not in its proper form") )
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core manages the set of APIs for user access.
func NewCore ¶
func NewCore(log *zap.SugaredLogger, sqlxDB *sqlx.DB) Core
NewCore constructs a core for user api access.
type Tag ¶
type Tag struct { ID string `json:"id"` Name string `json:"name"` Wid string `json:"wid"` DateCreated time.Time `json:"date_created"` DateUpdated time.Time `json:"date_updated"` }
Tag represents an individual tag.
type UpdateTag ¶
type UpdateTag struct {
Name *string `json:"name"`
}
UpdateTag defines what information may be provided to modify an existing tag. All fields are optional so tag can send just the fields they want changed. It uses pointer fields ,so we can differentiate between a field that was not provided and a field that was provided as explicitly blank. Normally we do not want to use pointers to basic types ,but we make exceptions around marshalling/unmarshalling.
Click to show internal directories.
Click to hide internal directories.