Documentation
¶
Index ¶
Constants ¶
const ( // OpaqueResources is a JSON list of resource IDs, each in the form <storage_id>!<opaque_id>. OpaqueResources = "resources" // OpaqueLabels is a JSON object from each requested resource ID to its labels. OpaqueLabels = "labels" )
The CS3 labels API has no call yet for the labels of given resources. Until it has one, ListLabels takes the resources in its request opaque and returns their labels in its response opaque.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
// List the unique labels that a user has attached to resources
ListLabels(ctx context.Context) ([]string, error)
// ListLabelsForResources returns the labels of the user for each given resource, keyed
// on <storage_id>!<opaque_id>. A resource without labels has no key.
ListLabelsForResources(ctx context.Context, ids []*provider.ResourceId) (map[string][]string, error)
// List the resources which have a given label attached for a given user
ListResourcesForLabel(ctx context.Context, label string) ([]*provider.ResourceId, error)
// SetLabel qttaches a label to a resource for a user..
SetLabel(ctx context.Context, label string, resourceId *provider.ResourceId) error
// UnsetLabel removes a label from a resource for a user..
UnsetLabel(ctx context.Context, label string, resourceId *provider.ResourceId) error
}
Manager defines an interface for a labels manager.