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 // ErrorCh is the channel on which errors from the xDS client are delivered. ErrorCh chan error // ResourceDoesNotExistCh is the channel used to indicate calls to OnResourceDoesNotExist ResourceDoesNotExistCh 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) OnError ¶ added in v1.54.0
func (w *TestResourceWatcher) OnError(err error, onDone xdsresource.OnDoneFunc)
OnError is invoked by the xDS client to report the latest error.
func (*TestResourceWatcher) OnResourceDoesNotExist ¶ added in v1.54.0
func (w *TestResourceWatcher) OnResourceDoesNotExist(onDone xdsresource.OnDoneFunc)
OnResourceDoesNotExist is used by the xDS client to report that the resource being watched no longer exists.
func (*TestResourceWatcher) OnUpdate ¶ added in v1.54.0
func (w *TestResourceWatcher) OnUpdate(data xdsresource.ResourceData, onDone xdsresource.OnDoneFunc)
OnUpdate is invoked by the xDS client to report the latest update on the resource being watched.
Directories
¶
Path | Synopsis |
---|---|
Package fakeclient provides a fake implementation of an xDS client.
|
Package fakeclient provides a fake implementation of an xDS client. |