state

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	SetStateFor(obj *objectv1alpha2.Object, state *unstructured.Unstructured)
	GetStateFor(obj *objectv1alpha2.Object) (*unstructured.Unstructured, bool)
}

Cache is the interface for the caching a k8s *unstructured.Unstructured object

type CacheManager

type CacheManager interface {
	LoadOrNewForManaged(mg xpresource.Managed) Cache
	Remove(mg xpresource.Managed)
}

CacheManager lets you manage Cache entries for XP managed resources

type DesiredStateCache

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

DesiredStateCache is a concurrency-safe implementation of Cache that holds a cached k8s object state with a hash key of the associated manifest. Hash key can be used to determine the validity of the cache entry

func (*DesiredStateCache) GetStateFor

GetStateFor returns the stored desired state if exists and valid, for the given *v1alpha2.Object

func (*DesiredStateCache) SetStateFor

func (dc *DesiredStateCache) SetStateFor(obj *objectv1alpha2.Object, state *unstructured.Unstructured)

SetStateFor stores the desired k8s object state for the given *v1alpha2.Object

type DesiredStateCacheManager

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

DesiredStateCacheManager stores the DesiredStateCache instances associated with the managed resource instance.

func NewDesiredStateCacheManager

func NewDesiredStateCacheManager() *DesiredStateCacheManager

NewDesiredStateCacheManager returns a new DesiredStateCacheManager instance

func (*DesiredStateCacheManager) LoadOrNewForManaged

func (dcs *DesiredStateCacheManager) LoadOrNewForManaged(mg xpresource.Managed) Cache

LoadOrNewForManaged returns the associated *DesiredStateCache stored in this DesiredStateCacheManager for the given managed resource. If there is no DesiredStateCache stored previously, a new DesiredStateCache is created and stored for the specified managed resource. Subsequent calls with the same managed resource will return the previously instantiated and stored DesiredStateCache for that managed resource

func (*DesiredStateCacheManager) Remove

Remove will remove the stored DesiredStateCache of the given managed resource from this DesiredStateCacheManager.

Jump to

Keyboard shortcuts

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