Documentation ¶
Overview ¶
Package cache
Implement client side caching for client.Client. This is useful for burst-happy applications that will try to query a lot of the same information in small chunks.
For example, an application could try to check the state of nodes, but do so using one request per node. This is obviously not ideal in larger cluster, where it would be more efficient to request the state of all nodes at once. Depending on the application, this may not be possible, however.
This package contains ready-to-use client side caches with configurable duration and automatic invalidation under the assumption that modifications are made from the same client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCaches ¶
WithCaches sets up the given caches on the client.Client.
Types ¶
type Filterable ¶ added in v0.52.2
type Filterable interface { client.Node | client.StoragePool | client.ResourceWithVolumes | client.Snapshot | client.PhysicalStorageViewItem }
type NodeCache ¶
type NodeCache struct { // Timeout for the cached responses. Timeout time.Duration // contains filtered or unexported fields }
NodeCache caches respones from a client.NodeProvider.
type ResourceCache ¶
type ResourceCache struct { // Timeout for the cached responses. Timeout time.Duration // contains filtered or unexported fields }
ResourceCache caches responses from a client.ResourceProvider.