Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Mgr = New()
Mgr is a global instance of label manager
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
// Create the label
Create(ctx context.Context, label *model.Label) (id int64, err error)
// Get the label specified by ID
Get(ctx context.Context, id int64) (label *model.Label, err error)
// Count returns the total count of Labels according to the query
Count(ctx context.Context, query *q.Query) (total int64, err error)
// Update the label
Update(ctx context.Context, label *model.Label) error
// Delete the label
Delete(ctx context.Context, id int64) (err error)
// List ...
List(ctx context.Context, query *q.Query) ([]*model.Label, error)
// List labels that added to the artifact specified by the ID
ListByArtifact(ctx context.Context, artifactID int64) (labels []*model.Label, err error)
// Add label to the artifact specified the ID
AddTo(ctx context.Context, labelID int64, artifactID int64) (err error)
// Remove the label added to the artifact specified by the ID
RemoveFrom(ctx context.Context, labelID int64, artifactID int64) (err error)
// Remove all labels added to the artifact specified by the ID
RemoveAllFrom(ctx context.Context, artifactID int64) (err error)
// RemoveFromAllArtifacts removes the label specified by the ID from all artifacts
RemoveFromAllArtifacts(ctx context.Context, labelID int64) (err error)
}
Manager manages the labels and references between label and resource
Click to show internal directories.
Click to hide internal directories.