Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 *slog.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).