attribute

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

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

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.

Jump to

Keyboard shortcuts

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