Documentation
¶
Index ¶
- type Service
- func (s *Service) GetAnnotations(ctx context.Context, id annotations.ID) (map[string]string, error)
- func (s *Service) GetCharmAnnotations(ctx context.Context, id annotation.GetCharmArgs) (map[string]string, error)
- func (s *Service) SetAnnotations(ctx context.Context, id annotations.ID, annotations map[string]string) error
- func (s *Service) SetCharmAnnotations(ctx context.Context, id annotation.GetCharmArgs, annotations map[string]string) error
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides the API for working with annotations.
func NewService ¶
NewService returns a new service reference wrapping the given annotations state.
func (*Service) GetAnnotations ¶
GetAnnotations retrieves all the annotations associated with a given ID. If no annotations are found, an empty map is returned.
func (*Service) GetCharmAnnotations ¶
func (s *Service) GetCharmAnnotations(ctx context.Context, id annotation.GetCharmArgs) (map[string]string, error)
GetCharmAnnotations retrieves all the annotations associated with a given charm argument. If no annotations are found, an empty map is returned.
func (*Service) SetAnnotations ¶
func (s *Service) SetAnnotations(ctx context.Context, id annotations.ID, annotations map[string]string) error
SetAnnotations associates key/value annotation pairs with a given ID. If an annotation already exists for the given ID, then it will be updated with the given value.
func (*Service) SetCharmAnnotations ¶
func (s *Service) SetCharmAnnotations(ctx context.Context, id annotation.GetCharmArgs, annotations map[string]string) error
SetCharmAnnotations associates key/value annotation pairs with a given charm argument. If an annotation already exists for the given ID, then it will be updated with the given value.
type State ¶
type State interface { // GetAnnotations retrieves all the annotations associated with a given ID. // If no annotations are found, an empty map is returned. GetAnnotations(ctx context.Context, ID annotations.ID) (map[string]string, error) // GetCharmAnnotations retrieves all the annotations associated with a given // ID. If no annotations are found, an empty map is returned. GetCharmAnnotations(ctx context.Context, ID annotation.GetCharmArgs) (map[string]string, error) // SetAnnotations associates key/value annotation pairs with a given ID. // If an annotation already exists for the given ID, then it will be updated // with the given value. First all annotations are deleted, then the given // pairs are inserted, so unsetting an annotation is implicit. SetAnnotations(ctx context.Context, ID annotations.ID, annotations map[string]string) error // SetCharmAnnotations associates key/value annotation pairs with a given ID. // If an annotation already exists for the given ID, then it will be updated // with the given value. First all annotations are deleted, then the given // pairs are inserted, so unsetting an annotation is implicit. SetCharmAnnotations(ctx context.Context, ID annotation.GetCharmArgs, annotations map[string]string) error }
State describes retrieval and persistence methods for annotations.