Documentation
¶
Index ¶
Constants ¶
const LevelDebug int = -2
const LevelInfo int = 0
const LevelWarn int = -1
Variables ¶
var Hash = cachev3.IDHash{}
Functions ¶
This section is empty.
Types ¶
type LogrWrapper ¶
type LogrWrapper struct {
// contains filtered or unexported fields
}
LogrWrapper is a nasty hack for turning the logr.Logger we get from NewLogger() into something that go-control-plane can accept. It seems pretty silly to take a zap logger, which is levelled, turn it into a V-style logr Logger, then turn it back again with this, but here we are. TODO(youngnick): Reopen the logging library discussion then do something about this.
func NewLogrWrapper ¶
func NewLogrWrapper(log logr.Logger) *LogrWrapper
func (LogrWrapper) Debugf ¶
func (l LogrWrapper) Debugf(template string, args ...interface{})
func (LogrWrapper) Errorf ¶
func (l LogrWrapper) Errorf(template string, args ...interface{})
func (LogrWrapper) Infof ¶
func (l LogrWrapper) Infof(template string, args ...interface{})
func (LogrWrapper) Warnf ¶
func (l LogrWrapper) Warnf(template string, args ...interface{})
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 logr.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).