cache

package
v0.52.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

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

func WithCaches(caches ...Cache) client.Option

WithCaches sets up the given caches on the client.Client.

Types

type Cache

type Cache interface {
	// contains filtered or unexported methods
}

type Filterable added in v0.52.2

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.

Jump to

Keyboard shortcuts

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