juju: github.com/juju/juju/core/annotations Index | Files

package annotations

import "github.com/juju/juju/core/annotations"


Package Files


type Annotation Uses

type Annotation map[string]string

Annotation extends k8s annotation map.

func New Uses

func New(as map[string]string) Annotation

New contructs an annotation.

func (Annotation) Add Uses

func (a Annotation) Add(key, value string) Annotation

Add inserts a new key value pair.

func (Annotation) CheckKeysNonEmpty Uses

func (a Annotation) CheckKeysNonEmpty(keys ...string) error

CheckKeysNonEmpty checks if the provided keys are all set to non empty value.

func (Annotation) Copy Uses

func (a Annotation) Copy() Annotation

Copy returns a copy of current annotation.

func (Annotation) Has Uses

func (a Annotation) Has(key, expectedValue string) bool

Has checks if the provided key value pair exists in this annotation or not.

func (Annotation) HasAll Uses

func (a Annotation) HasAll(expected map[string]string) bool

HasAll checks if all the provided key value pairs exist in this annotation or not.

func (Annotation) HasAny Uses

func (a Annotation) HasAny(expected map[string]string) bool

HasAny checks if any provided key value pairs exists in this annotation or not.

func (Annotation) Merge Uses

func (a Annotation) Merge(as Annotation) Annotation

Merge merges an annotation with current one.

func (Annotation) ToMap Uses

func (a Annotation) ToMap() map[string]string

ToMap returns the map format of the annotation.

Package annotations imports 2 packages (graph) and is imported by 5 packages. Updated 2019-05-18. Refresh now. Tools for package owners.