sets

package
v0.22.25 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 130

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFoundErr = func(resourceType ezkube.ResourceId, id ezkube.ResourceId) error {
	return eris.Errorf("%T with id %v not found", resourceType, Key(id))
}

Functions

func Key

func Key(id ezkube.ResourceId) string

k8s resources are uniquely identified by their name and namespace

func TypedKey added in v0.7.17

func TypedKey(id ezkube.ResourceId) string

typed keys are helpful for logging; currently unused in the Set implementation but placed here for convenience

Types

type ResourceDelta added in v0.7.17

type ResourceDelta struct {
	// the resources inserted into the set
	Inserted ResourceSet
	// the resources removed from the set
	Removed ResourceSet
}

ResourceDelta represents the set of changes between two ResourceSets.

type ResourceSet

type ResourceSet interface {
	Keys() sets.String
	List(filterResource ...func(ezkube.ResourceId) bool) []ezkube.ResourceId
	UnsortedList(filterResource ...func(ezkube.ResourceId) bool) []ezkube.ResourceId
	Map() map[string]ezkube.ResourceId
	Insert(resource ...ezkube.ResourceId)
	Equal(set ResourceSet) bool
	Has(resource ezkube.ResourceId) bool
	Delete(resource ezkube.ResourceId)
	Union(set ResourceSet) ResourceSet
	Difference(set ResourceSet) ResourceSet
	Intersection(set ResourceSet) ResourceSet
	Find(resourceType, id ezkube.ResourceId) (ezkube.ResourceId, error)
	Length() int
	// returns the delta between this and and another ResourceSet
	Delta(newSet ResourceSet) ResourceDelta
	// Clone returns a deep copy of the set
	Clone() ResourceSet
}

func NewResourceSet

func NewResourceSet(resources ...ezkube.ResourceId) ResourceSet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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