Documentation ¶
Index ¶
- func DeleteAll(attributes v1alpha2.AttributeList, name string) v1alpha2.AttributeList
- func Get(attributes v1alpha2.AttributeList, name string) (v1alpha2.AttributeInfo, bool)
- func Insert(attributes v1alpha2.AttributeList, attr v1alpha2.AttributeInfo) v1alpha2.AttributeList
- func Merge(existing, updated v1alpha2.AttributeList) v1alpha2.AttributeList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAll ¶
func DeleteAll(attributes v1alpha2.AttributeList, name string) v1alpha2.AttributeList
DeleteAll removes from the given AttributeList all the elements whose name matches the given `name`. Returns a new AttributeList with all the attributes removed, preserving as much as possible the current ordering between attributes.
func Get ¶
func Get(attributes v1alpha2.AttributeList, name string) (v1alpha2.AttributeInfo, bool)
Get looks for attribute by its name in the provided AtributeList. If found, returns the value of the attribute and an explicit boolean value equals true Otherwise, returns the zero value and explicit boolean value equals false. In case there are duplicates in the attribute list, returns the first attribute from the left found in iteration order, iterating on the attribute list treating it as a golang slice.
func Insert ¶
func Insert(attributes v1alpha2.AttributeList, attr v1alpha2.AttributeInfo) v1alpha2.AttributeList
Insert updates or adds an attribute to the provided AttributeList, preserving the existing order. The attribute name must be non-zero, the value can be zero. If the attribute is already present, its value is overridden with the given one; otherwise adds a new attribute preserving as much as possible the current ordering between attributes. Returns the updated AttributeList.
func Merge ¶
func Merge(existing, updated v1alpha2.AttributeList) v1alpha2.AttributeList
Merge joins `updated` into `existing`, preserving as much as possible the current ordering between attributes. Returns the merged attribute list, which includes the union of the elements from `existing` and `updated`. If an element is present in both lists, takes the value present in `updated`.
Types ¶
This section is empty.