Documentation
¶
Index ¶
- Constants
- func NewListerWatcher(storage storage.Interface, resourcePrefix string, ...) cache.ListerWatcher
- type CacheProxy
- func (c *CacheProxy) Count(pathPrefix string) (int64, error)
- func (c *CacheProxy) Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error
- func (c *CacheProxy) Delete(ctx context.Context, key string, out runtime.Object, ...) error
- func (c *CacheProxy) Get(ctx context.Context, key string, opts storage.GetOptions, ...) error
- func (c *CacheProxy) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (c *CacheProxy) GuaranteedUpdate(ctx context.Context, key string, destination runtime.Object, ...) error
- func (c *CacheProxy) ReadinessCheck() error
- func (c *CacheProxy) RequestWatchProgress(ctx context.Context) error
- func (c *CacheProxy) Versioner() storage.Versioner
- func (c *CacheProxy) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error)
- type Cacher
- func (c *Cacher) Get(ctx context.Context, key string, opts storage.GetOptions, ...) error
- func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (c *Cacher) LastSyncResourceVersion() (uint64, error)
- func (c *Cacher) Ready() bool
- func (c *Cacher) Stop()
- func (c *Cacher) Wait(ctx context.Context) error
- func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error)
- type Config
- type TickerFactory
- type WatchProgressRequester
Constants ¶
View Source
const ( Pending status = iota Ready Stopped )
View Source
const ( // DefaultEventFreshDuration is the default time duration of events // we want to keep. // We set it to defaultBookmarkFrequency plus epsilon to maximize // chances that last bookmark was sent within kept history, at the // same time, minimizing the needed memory usage. DefaultEventFreshDuration = defaultBookmarkFrequency + 15*time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheProxy ¶
type CacheProxy struct {
// contains filtered or unexported fields
}
func NewCacheProxy ¶
func NewCacheProxy(cacher *Cacher, storage storage.Interface) *CacheProxy
func (*CacheProxy) Delete ¶
func (c *CacheProxy) Delete(ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions, validateDeletion storage.ValidateObjectFunc, cachedExistingObject runtime.Object, opts storage.DeleteOptions) error
func (*CacheProxy) Get ¶
func (c *CacheProxy) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error
func (*CacheProxy) GetList ¶
func (c *CacheProxy) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error
func (*CacheProxy) GuaranteedUpdate ¶
func (c *CacheProxy) GuaranteedUpdate(ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool, preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, cachedExistingObject runtime.Object) error
func (*CacheProxy) ReadinessCheck ¶
func (c *CacheProxy) ReadinessCheck() error
func (*CacheProxy) RequestWatchProgress ¶
func (c *CacheProxy) RequestWatchProgress(ctx context.Context) error
func (*CacheProxy) Versioner ¶
func (c *CacheProxy) Versioner() storage.Versioner
type Cacher ¶
Cacher is responsible for serving WATCH and LIST requests for a given resource from its internal cache and updating its cache in the background based on the underlying storage contents. Cacher implements storage.Interface (although most of the calls are just delegated to the underlying storage).
func NewCacherFromConfig ¶
NewCacherFromConfig creates a new Cacher responsible for servicing WATCH and LIST requests from its internal cache and updating its cache in the background based on the given configuration.
func (*Cacher) GetList ¶ added in v0.24.0
func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object, listRV uint64) error
GetList implements storage.Interface
func (*Cacher) LastSyncResourceVersion ¶
LastSyncResourceVersion returns resource version to which the underlying cache is synced.
type Config ¶
type Config struct { // An underlying storage.Interface. Storage storage.Interface // An underlying storage.Versioner. Versioner storage.Versioner // The GroupResource the cacher is caching. Used for disambiguating *unstructured.Unstructured (CRDs) in logging // and metrics. GroupResource schema.GroupResource // EventsHistoryWindow specifies minimum history duration that storage is keeping. // If lower than DefaultEventFreshDuration, the cache creation will fail. EventsHistoryWindow time.Duration // The Cache will be caching objects of a given Type and assumes that they // are all stored under ResourcePrefix directory in the underlying database. ResourcePrefix string // KeyFunc is used to get a key in the underlying storage for a given object. KeyFunc func(runtime.Object) (string, error) // GetAttrsFunc is used to get object labels, fields GetAttrsFunc func(runtime.Object) (label labels.Set, field fields.Set, err error) // IndexerFuncs is used for optimizing amount of watchers that // needs to process an incoming event. IndexerFuncs storage.IndexerFuncs // Indexers is used to accelerate the list operation, falls back to regular list // operation if no indexer found. Indexers *cache.Indexers // NewFunc is a function that creates new empty object storing a object of type Type. NewFunc func() runtime.Object // NewList is a function that creates new empty object storing a list of // objects of type Type. NewListFunc func() runtime.Object Codec runtime.Codec Clock clock.WithTicker }
Config contains the configuration for a given Cache.
type TickerFactory ¶ added in v0.28.0
type WatchProgressRequester ¶ added in v0.28.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.