testutils
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package testutils provides utility types, for use in xds tests.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
Types¶
typeTestResourceWatcher¶
type TestResourceWatcher struct {// UpdateCh is the channel on which xDS client updates are delivered.UpdateCh chan *xdsresource.ResourceData// AmbientErrorCh is the channel on which ambient errors from the xDS// client are delivered.AmbientErrorCh chanerror// ResourceErrorCh is the channel on which resource errors from the xDS// client are delivered.ResourceErrorCh chan struct{}}TestResourceWatcher implements the xdsresource.ResourceWatcher interface,used to receive updates on watches registered with the xDS client, when usingthe resource-type agnostic WatchResource API.
Tests can use the channels provided by this type to get access to updates anderrors sent by the xDS client.
funcNewTestResourceWatcher¶
func NewTestResourceWatcher() *TestResourceWatcher
NewTestResourceWatcher returns a TestResourceWatcher to watch for resourcesvia the xDS client.
func (*TestResourceWatcher)AmbientError¶
func (w *TestResourceWatcher) AmbientError(errerror, onDone func())
AmbientError is invoked by the xDS client to report the latest ambienterror.
func (*TestResourceWatcher)ResourceChanged¶
func (w *TestResourceWatcher) ResourceChanged(dataxdsresource.ResourceData, onDone func())
ResourceChanged is invoked by the xDS client to report the latest update.
func (*TestResourceWatcher)ResourceError¶
func (w *TestResourceWatcher) ResourceError(errerror, onDone func())
ResourceError is invoked by the xDS client to report the latest error tostop watching the resource.
Directories¶
| Path | Synopsis |
|---|---|
Package fakeclient provides a fake implementation of an xDS client. | Package fakeclient provides a fake implementation of an xDS client. |