cluster-api: Index | Files

package util

import ""


Package Files

set.go util.go

func MemberForName Uses

func MemberForName(members []*etcd.Member, name string) *etcd.Member

MemberForName returns the etcd member with the matching name.

type UInt64Set Uses

type UInt64Set map[uint64]empty

util.UInt64Set is a set of uint64s, implemented via map[uint64]struct{} for minimal memory consumption.

func MemberIDSet Uses

func MemberIDSet(members []*etcd.Member) UInt64Set

MemberIDSet returns a set of member IDs.

func NewUInt64Set Uses

func NewUInt64Set(items ...uint64) UInt64Set

NewUInt64Set creates a UInt64Set from a list of values.

func (UInt64Set) Delete Uses

func (s UInt64Set) Delete(items ...uint64) UInt64Set

Delete removes all items from the set.

func (UInt64Set) Difference Uses

func (s UInt64Set) Difference(s2 UInt64Set) UInt64Set

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 (UInt64Set) Equal Uses

func (s UInt64Set) Equal(s2 UInt64Set) 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 (UInt64Set) Has Uses

func (s UInt64Set) Has(item uint64) bool

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

func (UInt64Set) HasAll Uses

func (s UInt64Set) HasAll(items ...uint64) bool

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

func (UInt64Set) HasAny Uses

func (s UInt64Set) HasAny(items ...uint64) bool

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

func (UInt64Set) Insert Uses

func (s UInt64Set) Insert(items ...uint64) UInt64Set

Insert adds items to the set.

func (UInt64Set) Intersection Uses

func (s UInt64Set) Intersection(s2 UInt64Set) UInt64Set

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 (UInt64Set) IsSuperset Uses

func (s UInt64Set) IsSuperset(s2 UInt64Set) bool

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

func (UInt64Set) Len Uses

func (s UInt64Set) Len() int

Len returns the size of the set.

func (UInt64Set) List Uses

func (s UInt64Set) List() []uint64

List returns the contents as a sorted uint64 slice.

func (UInt64Set) PopAny Uses

func (s UInt64Set) PopAny() (uint64, bool)

Returns a single element from the set.

func (UInt64Set) Union Uses

func (s UInt64Set) Union(s2 UInt64Set) UInt64Set

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 (UInt64Set) UnsortedList Uses

func (s UInt64Set) UnsortedList() []uint64

UnsortedList returns the slice with contents in random order.

Package util imports 2 packages (graph) and is imported by 1 packages. Updated 2020-03-02. Refresh now. Tools for package owners.