store.go 770 B

12345678910111213141516171819202122
  1. package namespaces
  2. import "context"
  3. // Store provides introspection about namespaces.
  4. //
  5. // Note that these are slightly different than other objects, which are record
  6. // oriented. A namespace is really just a name and a set of labels. Objects
  7. // that belong to a namespace are returned when the namespace is assigned to a
  8. // given context.
  9. //
  10. //
  11. type Store interface {
  12. Create(ctx context.Context, namespace string, labels map[string]string) error
  13. Labels(ctx context.Context, namespace string) (map[string]string, error)
  14. SetLabel(ctx context.Context, namespace, key, value string) error
  15. List(ctx context.Context) ([]string, error)
  16. // Delete removes the namespace. The namespace must be empty to be deleted.
  17. Delete(ctx context.Context, namespace string) error
  18. }