annotations

package
v0.0.0-...-e653fdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation map[string]string

Annotation extends k8s annotation map.

func New

func New(as map[string]string) Annotation

New contructs an annotation.

func (Annotation) Add

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

Add inserts a new key value pair.

func (Annotation) CheckKeysNonEmpty

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

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

func (Annotation) Copy

func (a Annotation) Copy() Annotation

Copy returns a copy of current annotation.

func (Annotation) Has

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

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

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

func (a Annotation) Merge(as Annotation) Annotation

Merge merges an annotation with current one.

func (Annotation) Remove

func (a Annotation) Remove(key string) Annotation

Remove deletes the key and its value from the annotation.

func (Annotation) ToMap

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

ToMap returns the map format of the annotation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL