cache

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hash = cachev3.IDHash{}

Functions

This section is empty.

Types

type SnapshotCacheWithCallbacks

type SnapshotCacheWithCallbacks interface {
	cachev3.SnapshotCache
	serverv3.Callbacks
	GenerateNewSnapshot(string, types.XdsResources) error
}

SnapshotCacheWithCallbacks uses the go-control-plane SimpleCache to store snapshots of Envoy resources, sliced by Node ID so that we can do incremental xDS properly. It does this by also implementing callbacks to make sure that the cache is kept up to date for each new node.

Having the cache also implement the callbacks is a little bit hacky, but it makes sure that all the required bookkeeping happens. TODO(youngnick): Talk to the go-control-plane maintainers and see if we can upstream this in a better way.

func NewSnapshotCache

func NewSnapshotCache(ads bool, logger logging.Logger) SnapshotCacheWithCallbacks

NewSnapshotCache gives you a fresh SnapshotCache. It needs a logger that supports the go-control-plane required interface (Debugf, Infof, Warnf, and Errorf).

Jump to

Keyboard shortcuts

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