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 ¶
type TestResourceWatcher ¶ added in v1.54.0
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 chan error // 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 using the resource-type agnostic WatchResource API.
Tests can use the channels provided by this type to get access to updates and errors sent by the xDS client.
func NewTestResourceWatcher ¶ added in v1.54.0
func NewTestResourceWatcher() *TestResourceWatcher
NewTestResourceWatcher returns a TestResourceWatcher to watch for resources via the xDS client.
func (*TestResourceWatcher) AmbientError ¶ added in v1.73.0
func (w *TestResourceWatcher) AmbientError(err error, onDone func())
AmbientError is invoked by the xDS client to report the latest ambient error.
func (*TestResourceWatcher) ResourceChanged ¶ added in v1.73.0
func (w *TestResourceWatcher) ResourceChanged(data xdsresource.ResourceData, onDone func())
ResourceChanged is invoked by the xDS client to report the latest update.
func (*TestResourceWatcher) ResourceError ¶ added in v1.73.0
func (w *TestResourceWatcher) ResourceError(err error, onDone func())
ResourceError is invoked by the xDS client to report the latest error to stop 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. |