aggregator

package
v3.15.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GVKAgreggator

type GVKAgreggator struct {
	// contains filtered or unexported fields
}

GVKAgreggator is an implementation of a bi directional map that stores associations between Key K and GVKs and reverse associations between GVK g and Keys.

func NewGVKAggregator

func NewGVKAggregator() *GVKAgreggator

func (*GVKAgreggator) GVKs

GVKs returns a list of all of the schema.GroupVersionKind that are aggregated.

func (*GVKAgreggator) IsPresent

func (b *GVKAgreggator) IsPresent(gvk schema.GroupVersionKind) bool

IsPresent returns true if the given gvk is present in the GVKAggregator.

func (*GVKAgreggator) List

func (b *GVKAgreggator) List(k Key) map[schema.GroupVersionKind]struct{}

List returnes the gvk set for a given Key.

func (*GVKAgreggator) Remove

func (b *GVKAgreggator) Remove(k Key) error

Remove deletes any associations that Key k has in the GVKAggregator. For any GVK in the association k --> [GVKs], we also delete any associations between the GVK and the Key k stored in the reverse map.

func (*GVKAgreggator) Upsert

func (b *GVKAgreggator) Upsert(k Key, gvks []schema.GroupVersionKind) error

Upsert stores an association between Key k and the list of GVKs and also the reverse associatoin between each GVK passed in and Key k. Any old associations are dropped, unless they are included in the new list of GVKs. It errors out if there is an internal issue with remove the reverse Key links for any GVKs that are being dropped as part of this Upsert call.

type Key

type Key struct {
	// Source specifies the type or where this Key comes from.
	Source string
	// ID specifies the name of the type that this Key is.
	ID string
}

Key defines a type, identifier tuple to store in the GVKAggregator.

Jump to

Keyboard shortcuts

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