keycache

package
v2.8.0-nightly.20230919 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache watches a key in etcd and caches the value in an atomic value This is useful for frequently read but infrequently updated values

func NewCache

func NewCache(ctx context.Context, readOnly col.ReadOnlyCollection, key string, defaultValue proto.Message) *Cache

NewCache returns a cache for the given key in the etcd collection

func (*Cache) Load

func (c *Cache) Load() interface{}

Load retrieves the current cached value

func (*Cache) Watch

func (c *Cache) Watch()

Watch should be called in a goroutine to start the watcher

Jump to

Keyboard shortcuts

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