stores

package
v2.0.0-...-345fa11 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const IndexMeterDefinition = "meterDefinition"
View Source
const IndexNamespace = "namespace"

Variables

This section is empty.

Functions

func EnhancedObjectKeyFunc

func EnhancedObjectKeyFunc(scheme *runtime.Scheme) func(obj interface{}) (string, error)

func MeterDefinitionIndexFunc

func MeterDefinitionIndexFunc(obj interface{}) ([]string, error)

func ProvideMeterDefinitionList

func ProvideMeterDefinitionList(
	cacheIsStarted managers.CacheIsStarted,
	client runtimeClient.Client,
) (*v1beta1.MeterDefinitionList, error)

Types

type MeterDefinitionDictionary

type MeterDefinitionDictionary struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MeterDefinitionDictionary tracks the meterdefinitions current on the system and provides methods of checking if a resources is apart of the meterdefinition.

func (*MeterDefinitionDictionary) Add

func (def *MeterDefinitionDictionary) Add(obj interface{}) error

Add adds the given object to the accumulator associated with the given object's key

func (*MeterDefinitionDictionary) AddIfNotPresent

func (def *MeterDefinitionDictionary) AddIfNotPresent(obj interface{}) error

func (*MeterDefinitionDictionary) Close

func (def *MeterDefinitionDictionary) Close()

func (*MeterDefinitionDictionary) Delete

func (def *MeterDefinitionDictionary) Delete(obj interface{}) error

Delete deletes the given object from the accumulator associated with the given object's key

func (*MeterDefinitionDictionary) FindObjectMatches

func (def *MeterDefinitionDictionary) FindObjectMatches(
	obj interface{},
	results *[]filter.Result,
) error

func (*MeterDefinitionDictionary) Get

func (def *MeterDefinitionDictionary) Get(obj interface{}) (item interface{}, exists bool, err error)

Get returns the accumulator associated with the given object's key

func (*MeterDefinitionDictionary) GetByKey

func (def *MeterDefinitionDictionary) GetByKey(key string) (item interface{}, exists bool, err error)

GetByKey returns the accumulator associated with the given key

func (*MeterDefinitionDictionary) HasSynced

func (def *MeterDefinitionDictionary) HasSynced() bool

func (*MeterDefinitionDictionary) List

func (def *MeterDefinitionDictionary) List() []interface{}

List returns a list of all the currently non-empty accumulators

func (*MeterDefinitionDictionary) ListFilters

func (*MeterDefinitionDictionary) ListKeys

func (def *MeterDefinitionDictionary) ListKeys() []string

ListKeys returns a list of all the keys currently associated with non-empty accumulators

func (*MeterDefinitionDictionary) Pop

func (def *MeterDefinitionDictionary) Pop(process cache.PopProcessFunc) (interface{}, error)

func (*MeterDefinitionDictionary) Replace

func (def *MeterDefinitionDictionary) Replace(in []interface{}, str string) error

Replace will delete the contents of the store, using instead the given list. Store takes ownership of the list, you should not reference it after calling this function.

func (*MeterDefinitionDictionary) Resync

func (def *MeterDefinitionDictionary) Resync() error

Resync is meaningless in the terms appearing here but has meaning in some implementations that have non-trivial additional behavior (e.g., DeltaFIFO).

func (*MeterDefinitionDictionary) Update

func (def *MeterDefinitionDictionary) Update(obj interface{}) error

Update updates the given object in the accumulator associated with the given object's key

type MeterDefinitionExtended

type MeterDefinitionExtended struct {
	*v1beta1.MeterDefinition
	Filter *filter.MeterDefinitionLookupFilter
}

type MeterDefinitionStore

type MeterDefinitionStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MeterDefinitionStore keeps the MeterDefinitions in place and tracks the dependents using the rules based on the spec. MeterDefinition controller uses this to effectively find the child assets of a meter definition rules.

func NewMeterDefinitionStore

func NewMeterDefinitionStore(
	ctx context.Context,
	log logr.Logger,
	dictionary *MeterDefinitionDictionary,
	scheme *runtime.Scheme,
) *MeterDefinitionStore

func (*MeterDefinitionStore) Add

func (s *MeterDefinitionStore) Add(obj interface{}) error

Add inserts adds to the OwnerCache by calling the metrics generator functions and adding the generated metrics to the metrics map that underlies the MetricStore.

func (*MeterDefinitionStore) AddIfNotPresent

func (s *MeterDefinitionStore) AddIfNotPresent(obj interface{}) error

func (*MeterDefinitionStore) ByIndex

func (s *MeterDefinitionStore) ByIndex(indexName, indexedValue string) ([]interface{}, error)

func (*MeterDefinitionStore) Close

func (s *MeterDefinitionStore) Close()

func (*MeterDefinitionStore) Delete

func (s *MeterDefinitionStore) Delete(obj interface{}) error

Delete deletes an existing entry in the OwnerCache.

func (*MeterDefinitionStore) DeleteFromIndex

func (s *MeterDefinitionStore) DeleteFromIndex(obj interface{}) error

Delete deletes an existing entry in the OwnerCache.

func (*MeterDefinitionStore) Get

func (s *MeterDefinitionStore) Get(obj interface{}) (item interface{}, exists bool, err error)

Get implements the Get method of the store interface.

func (*MeterDefinitionStore) GetByKey

func (s *MeterDefinitionStore) GetByKey(key string) (item interface{}, exists bool, err error)

GetByKey implements the GetByKey method of the store interface.

func (*MeterDefinitionStore) HasSynced

func (s *MeterDefinitionStore) HasSynced() bool

func (*MeterDefinitionStore) List

func (s *MeterDefinitionStore) List() []interface{}

List implements the List method of the store interface.

func (*MeterDefinitionStore) ListKeys

func (s *MeterDefinitionStore) ListKeys() []string

ListKeys implements the ListKeys method of the store interface.

func (*MeterDefinitionStore) Pop

func (s *MeterDefinitionStore) Pop(process cache.PopProcessFunc) (interface{}, error)

func (*MeterDefinitionStore) Replace

func (s *MeterDefinitionStore) Replace(list []interface{}, _ string) error

Replace will delete the contents of the store, using instead the given list.

func (*MeterDefinitionStore) Resync

func (s *MeterDefinitionStore) Resync() error

Resync implements the Resync method of the store interface. Resync walks the entire cache to refresh the Object matches to MeterDefinitions Updates and Delta deletes if the no MeterDefinitions match

func (*MeterDefinitionStore) SyncByIndex

func (s *MeterDefinitionStore) SyncByIndex(indexName, indexedValue string) error

For a MeterDefinition event, Delta Add or Delete Objects if they still match

func (*MeterDefinitionStore) Update

func (s *MeterDefinitionStore) Update(obj interface{}) error

Update updates the existing entry in the OwnerCache.

type MeterDefinitionStores

type MeterDefinitionStores = map[string]*MeterDefinitionStore

Jump to

Keyboard shortcuts

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