Movatterモバイル変換


[0]ホーム

URL:


fakeclient

package
v1.77.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License:Apache-2.0Imports:6Imported by:0

Details

Repository

github.com/grpc/grpc-go

Links

Documentation

Overview

Package fakeclient provides a fake implementation of an xDS client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeClient

type Client struct {// Embed XDSClient so this fake client implements the interface, but it's// never set (it's always nil). This may cause nil panic since not all the// methods are implemented.xdsclient.XDSClient// contains filtered or unexported fields}

Client is a fake implementation of an xds client. It exposes a bunch ofchannels to signal the occurrence of various events.

funcNewClient

func NewClient() *Client

NewClient returns a new fake xds client.

funcNewClientWithName

func NewClientWithName(namestring) *Client

NewClientWithName returns a new fake xds client with the provided name. Thisis used in cases where multiple clients are created in the tests and we needto make sure the client is created for the expected balancer name.

func (*Client)BootstrapConfig

func (xdsC *Client) BootstrapConfig() *bootstrap.Config

BootstrapConfig returns the bootstrap config.

func (*Client)LoadStore

func (xdsC *Client) LoadStore() *lrsclient.LoadStore

LoadStore returns the underlying load data store.

func (*Client)Name

func (xdsC *Client) Name()string

Name returns the name of the xds client.

func (*Client)ReportLoad

func (xdsC *Client) ReportLoad(server *bootstrap.ServerConfig) (loadStore *lrsclient.LoadStore, cancel func(context.Context))

ReportLoad starts reporting load about clusterName to server.

func (*Client)SetBootstrapConfig

func (xdsC *Client) SetBootstrapConfig(cfg *bootstrap.Config)

SetBootstrapConfig updates the bootstrap config.

func (*Client)WaitForCancelReportLoad

func (xdsC *Client) WaitForCancelReportLoad(ctxcontext.Context)error

WaitForCancelReportLoad waits for a load report to be cancelled and returnscontext.DeadlineExceeded otherwise.

func (*Client)WaitForReportLoad

func (xdsC *Client) WaitForReportLoad(ctxcontext.Context) (ReportLoadArgs,error)

WaitForReportLoad waits for ReportLoad to be invoked on this client andreturns the arguments passed to it.

typeReportLoadArgs

type ReportLoadArgs struct {// Server is the name of the server to which the load is reported.Server *bootstrap.ServerConfig}

ReportLoadArgs wraps the arguments passed to ReportLoad.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp