helper

package
v0.0.0-...-e191437 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCondition

func DeleteCondition(conditions []v1.Condition, conditionType v1.ConditionType) []v1.Condition

func DiffCondition

func DiffCondition(condition1 *v1.Condition, condition2 *v1.Condition) bool

func GetCondition

func GetCondition(conditions []v1.Condition, condition *v1.Condition) *v1.Condition

func IsConditionTrue

func IsConditionTrue(conditions []v1.Condition, condition v1.Condition) bool

func IsConditionsTrue

func IsConditionsTrue(conditions []v1.Condition) bool

func SetConditionError

func SetConditionError(condition *v1.Condition, reason string, err error)

func UpdateCondition

func UpdateCondition(conditions []v1.Condition, condition v1.Condition) []v1.Condition

UpdateCondition updates condition in cluster conditions using giving condition adds condition if not existed

Types

type Any

type Any map[string]any

sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption.

func NewAny

func NewAny(items map[string]any) Any

NewAny creates a Any from a list of values.

func (Any) Delete

func (s Any) Delete(items ...string) Any

Delete removes all items from the set.

func (Any) Difference

func (s Any) Difference(s2 Any) Any

Difference returns a set of objects that are not in s2 For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} s1.Difference(s2) = {a3} s2.Difference(s1) = {a4, a5}

func (Any) Equal

func (s1 Any) Equal(s2 Any) bool

Equal returns true if and only if s1 is equal (as a set) to s2. Two sets are equal if their membership is identical. (In practice, this means same elements, order doesn't matter)

func (Any) Has

func (s Any) Has(item string) bool

Has returns true if and only if item is contained in the set.

func (Any) HasAll

func (s Any) HasAll(items ...string) bool

HasAll returns true if and only if all items are contained in the set.

func (Any) HasAny

func (s Any) HasAny(items ...string) bool

HasAny returns true if any items are contained in the set.

func (Any) Insert

func (s Any) Insert(items map[string]any) Any

Insert adds items to the set.

func (Any) InsertValue

func (s Any) InsertValue(key string, value any) Any

func (Any) Intersection

func (s1 Any) Intersection(s2 Any) Any

Intersection returns a new set which includes the item in BOTH s1 and s2 For example: s1 = {a1, a2} s2 = {a2, a3} s1.Intersection(s2) = {a2}

func (Any) IsSuperset

func (s1 Any) IsSuperset(s2 Any) bool

IsSuperset returns true if and only if s1 is a superset of s2.

func (Any) Len

func (s Any) Len() int

Len returns the size of the set.

func (Any) ListKey

func (s Any) ListKey() []string

List returns the contents as a sorted string slice.

func (Any) ListValue

func (s Any) ListValue() []any

List returns the contents as a sorted string slice.

func (Any) PopAny

func (s Any) PopAny() (string, bool)

Returns a single element from the set.

func (Any) Union

func (s1 Any) Union(s2 Any) Any

Union returns a new set which includes items in either s1 or s2. For example: s1 = {a1, a2} s2 = {a3, a4} s1.Union(s2) = {a1, a2, a3, a4} s2.Union(s1) = {a1, a2, a3, a4}

func (Any) UnsortedList

func (s Any) UnsortedList() []string

UnsortedList returns the slice with contents in random order.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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