Documentation ¶
Index ¶
- func Apply(ctx context.Context, c client.Client, o client.Object, fns ...UpdateFn) error
- func Set(o client.Object, fns ...UpdateFn)
- type Annotation
- func (a Annotation) Add(val string) UpdateFn
- func (a Annotation) AddToList(val string) UpdateFn
- func (a Annotation) ParseObjectName(o client.Object) (types.NamespacedName, bool)
- func (a Annotation) Remove() UpdateFn
- func (a Annotation) RemoveFromList(val string) UpdateFn
- func (a Annotation) String() string
- type UpdateFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Annotation ¶ added in v0.1.0
type Annotation string
Annotation is a string type that can be used as a convenience wrapper for the exported functions of this package.
func (Annotation) Add ¶ added in v0.1.0
func (a Annotation) Add(val string) UpdateFn
Add adds/sets a single value annotation.
func (Annotation) AddToList ¶ added in v0.1.0
func (a Annotation) AddToList(val string) UpdateFn
AddToList adds the value to the annotation list.
func (Annotation) ParseObjectName ¶ added in v0.1.0
func (a Annotation) ParseObjectName(o client.Object) (types.NamespacedName, bool)
ParseObjectName attempts to parse an object name from an annotation on the given object.
func (Annotation) Remove ¶ added in v0.1.0
func (a Annotation) Remove() UpdateFn
Remove removes the annotation.
func (Annotation) RemoveFromList ¶ added in v0.1.0
func (a Annotation) RemoveFromList(val string) UpdateFn
RemoveFromList removes the value from the list.
func (Annotation) String ¶ added in v0.1.0
func (a Annotation) String() string
String returns the annotation name.
type UpdateFn ¶
UpdateFn is any function that mutates a string map.
func AddToList ¶ added in v0.0.2
AddToList returns an UpdateFn which adds v to a list stored in k.
If the list does not exist it will create it.
func RemoveFromList ¶ added in v0.0.2
RemoveFromList returns an UpdateFn which removes v from a list stored in k.
If the list does not exist, it does nothing. If the value remaning afterwards is empty, it will delete the key.