cachemanager

package
v3.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const RegistrarName = "cachemanager"

Variables

This section is empty.

Functions

This section is empty.

Types

type CFDataClient

type CFDataClient interface {
	AddData(ctx context.Context, data interface{}) (*types.Responses, error)
	RemoveData(ctx context.Context, data interface{}) (*types.Responses, error)
}

CFDataClient is an interface for caching data.

type CacheManager

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

func NewCacheManager

func NewCacheManager(config *Config) (*CacheManager, error)

func (*CacheManager) AddObject

func (c *CacheManager) AddObject(ctx context.Context, instance *unstructured.Unstructured) error

func (*CacheManager) DoForEach

func (c *CacheManager) DoForEach(fn func(gvk schema.GroupVersionKind) error) error

DoForEach runs fn for each GVK that is being watched by the cache manager. This is handy when we want to take actions while holding the lock on the watched.Set.

func (*CacheManager) ExcludeProcesses

func (c *CacheManager) ExcludeProcesses(newExcluder *process.Excluder)

ExcludeProcesses swaps the current process excluder with the new *process.Excluder. It's a no-op if the two excluders are equal.

func (*CacheManager) RemoveObject

func (c *CacheManager) RemoveObject(ctx context.Context, instance *unstructured.Unstructured) error

func (*CacheManager) RemoveSource

func (c *CacheManager) RemoveSource(ctx context.Context, sourceKey aggregator.Key) error

RemoveSource removes the watches of the GVKs for a given aggregator.Key. Callers are responsible for retrying on error.

func (*CacheManager) ReportSyncMetrics

func (c *CacheManager) ReportSyncMetrics()

func (*CacheManager) Start

func (c *CacheManager) Start(ctx context.Context) error

func (*CacheManager) UpsertSource

func (c *CacheManager) UpsertSource(ctx context.Context, sourceKey aggregator.Key, newGVKs []schema.GroupVersionKind) error

UpsertSource adjusts the watched set of gvks according to the newGVKs passed in for a given sourceKey. Callers are responsible for retrying on error.

func (*CacheManager) WatchedGVKs added in v3.15.0

func (c *CacheManager) WatchedGVKs() []schema.GroupVersionKind

type Config

type Config struct {
	CfClient         CFDataClient
	SyncMetricsCache *syncutil.MetricsCache
	Tracker          *readiness.Tracker
	ProcessExcluder  *process.Excluder
	Registrar        *watch.Registrar
	GVKAggregator    *aggregator.GVKAgreggator
	Reader           client.Reader
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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