Documentation ¶
Index ¶
- Constants
- type CFDataClient
- type CacheManager
- func (c *CacheManager) AddObject(ctx context.Context, instance *unstructured.Unstructured) error
- func (c *CacheManager) DoForEach(fn func(gvk schema.GroupVersionKind) error) error
- func (c *CacheManager) ExcludeProcesses(newExcluder *process.Excluder)
- func (c *CacheManager) RemoveObject(ctx context.Context, instance *unstructured.Unstructured) error
- func (c *CacheManager) RemoveSource(ctx context.Context, sourceKey aggregator.Key) error
- func (c *CacheManager) ReportSyncMetrics()
- func (c *CacheManager) Start(ctx context.Context) error
- func (c *CacheManager) UpsertSource(ctx context.Context, sourceKey aggregator.Key, ...) error
- func (c *CacheManager) WatchedGVKs() []schema.GroupVersionKind
- type Config
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) 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 }
Click to show internal directories.
Click to hide internal directories.