cache

package
v1.21.6 Latest Latest
Warning

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

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

Documentation

Overview

Package cache contains the constants and functions for reading/writing to the process local cache some specific supported objects

Index

Constants

View Source
const (
	// ClusterKey is the key to be used to access the cached cluster
	ClusterKey = "cluster"
	// WALArchiveKey is the key to be used to access the cached envs for wal-archive
	WALArchiveKey = "wal-archive"
	// WALRestoreKey is the key to be used to access the cached envs for wal-restore
	WALRestoreKey = "wal-restore"
)

Variables

View Source
var (
	ErrCacheMiss         = errors.New("cache miss")
	ErrUnsupportedObject = errors.New("unsupported cache object")
)

ErrCacheMiss is returned when the requested value is not found in cache, or it is expired.

Functions

func Delete

func Delete(c string)

Delete an object from the local cache

func LoadClusterUnsafe added in v1.19.5

func LoadClusterUnsafe() (*apiv1.Cluster, error)

LoadClusterUnsafe retrieves a cluster from the local cache. Warning:

The returned pointer can potentially be accessed concurrently.
Only use this function for read-only operations. If you need to
modify the cluster, always create a DeepCopy of the returned object
before writing to it.

func LoadEnv

func LoadEnv(c string) ([]string, error)

LoadEnv loads a key from the local cache

func Store

func Store(c string, v interface{})

Store write an object into the local cache

func StoreCluster added in v1.19.5

func StoreCluster(cluster *apiv1.Cluster)

StoreCluster write a cluster object into the local cache

Types

This section is empty.

Directories

Path Synopsis
Package client contains the constants and functions for reading supported objects from cache or building them in case of cache miss.
Package client contains the constants and functions for reading supported objects from cache or building them in case of cache miss.

Jump to

Keyboard shortcuts

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