Documentation ¶
Overview ¶
Package fakeclient provides a fake implementation of an xDS client.
Index ¶
- type Client
- func (xdsC *Client) Close()
- func (xdsC *Client) InvokeWatchClusterCallback(update xdsclient.ClusterUpdate, err error)
- func (xdsC *Client) InvokeWatchEDSCallback(update xdsclient.EndpointsUpdate, err error)
- func (xdsC *Client) InvokeWatchServiceCallback(u xdsclient.ServiceUpdate, err error)
- func (xdsC *Client) LoadStore() *load.Store
- func (xdsC *Client) Name() string
- func (xdsC *Client) ReportLoad(server string, clusterName string) (cancel func())
- func (xdsC *Client) WaitForCancelClusterWatch(ctx context.Context) error
- func (xdsC *Client) WaitForCancelEDSWatch(ctx context.Context) error
- func (xdsC *Client) WaitForClose(ctx context.Context) error
- func (xdsC *Client) WaitForReportLoad(ctx context.Context) (ReportLoadArgs, error)
- func (xdsC *Client) WaitForWatchCluster(ctx context.Context) (string, error)
- func (xdsC *Client) WaitForWatchEDS(ctx context.Context) (string, error)
- func (xdsC *Client) WaitForWatchService(ctx context.Context) (string, error)
- func (xdsC *Client) WatchCluster(clusterName string, callback func(xdsclient.ClusterUpdate, error)) func()
- func (xdsC *Client) WatchEndpoints(clusterName string, callback func(xdsclient.EndpointsUpdate, error)) (cancel func())
- func (xdsC *Client) WatchService(target string, callback func(xdsclient.ServiceUpdate, error)) func()
- type ReportLoadArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a fake implementation of an xds client. It exposes a bunch of channels to signal the occurrence of various events.
func NewClientWithName ¶
NewClientWithName returns a new fake xds client with the provided name. This is used in cases where multiple clients are created in the tests and we need to make sure the client is created for the expected balancer name.
func (*Client) InvokeWatchClusterCallback ¶
func (xdsC *Client) InvokeWatchClusterCallback(update xdsclient.ClusterUpdate, err error)
InvokeWatchClusterCallback invokes the registered cdsWatch callback.
func (*Client) InvokeWatchEDSCallback ¶
func (xdsC *Client) InvokeWatchEDSCallback(update xdsclient.EndpointsUpdate, err error)
InvokeWatchEDSCallback invokes the registered edsWatch callback.
func (*Client) InvokeWatchServiceCallback ¶
func (xdsC *Client) InvokeWatchServiceCallback(u xdsclient.ServiceUpdate, err error)
InvokeWatchServiceCallback invokes the registered service watch callback.
func (*Client) ReportLoad ¶
ReportLoad starts reporting load about clusterName to server.
func (*Client) WaitForCancelClusterWatch ¶
WaitForCancelClusterWatch waits for a CDS watch to be cancelled and returns context.DeadlineExceeded otherwise.
func (*Client) WaitForCancelEDSWatch ¶ added in v1.30.0
WaitForCancelEDSWatch waits for a EDS watch to be cancelled and returns context.DeadlineExceeded otherwise.
func (*Client) WaitForClose ¶
WaitForClose waits for Close to be invoked on this client and returns context.DeadlineExceeded otherwise.
func (*Client) WaitForReportLoad ¶
func (xdsC *Client) WaitForReportLoad(ctx context.Context) (ReportLoadArgs, error)
WaitForReportLoad waits for ReportLoad to be invoked on this client and returns the arguments passed to it.
func (*Client) WaitForWatchCluster ¶
WaitForWatchCluster waits for WatchCluster to be invoked on this client and returns the clusterName being watched.
func (*Client) WaitForWatchEDS ¶
WaitForWatchEDS waits for WatchEndpoints to be invoked on this client and returns the clusterName being watched.
func (*Client) WaitForWatchService ¶
WaitForWatchService waits for WatchService to be invoked on this client and returns the serviceName being watched.
func (*Client) WatchCluster ¶
func (xdsC *Client) WatchCluster(clusterName string, callback func(xdsclient.ClusterUpdate, error)) func()
WatchCluster registers a CDS watch.
func (*Client) WatchEndpoints ¶ added in v1.29.0
func (xdsC *Client) WatchEndpoints(clusterName string, callback func(xdsclient.EndpointsUpdate, error)) (cancel func())
WatchEndpoints registers an EDS watch for provided clusterName.
func (*Client) WatchService ¶
func (xdsC *Client) WatchService(target string, callback func(xdsclient.ServiceUpdate, error)) func()
WatchService registers a LDS/RDS watch.
type ReportLoadArgs ¶
type ReportLoadArgs struct { // Server is the name of the server to which the load is reported. Server string // Cluster is the name of the cluster for which load is reported. Cluster string }
ReportLoadArgs wraps the arguments passed to ReportLoad.