Versions in this module Expand all Collapse all v1 v1.0.0 Jun 21, 2023 Changes in this version + const DefaultChanBufferSize + const DefaultHTTPRequestTimeout + const TestSubConnsCount + var ErrTestConstPicker = fmt.Errorf("const picker error") + var TestSubConns []*TestSubConn + func IsRoundRobin(want []balancer.SubConn, f func() balancer.SubConn) error + func LocalTCPListener() (net.Listener, error) + func MarshalAny(m proto.Message) *anypb.Any + func MustParseURL(target string) *url.URL + func NewTestWRR() wrr.WRR + func ParsePort(t *testing.T, addr string) uint32 + func StatusErrEqual(err1, err2 error) bool + func SubConnFromPicker(p balancer.Picker) func() balancer.SubConn + type Channel struct + func NewChannel() *Channel + func NewChannelWithSize(bufSize int) *Channel + func (c *Channel) Receive(ctx context.Context) (interface{}, error) + func (c *Channel) ReceiveOrFail() (interface{}, bool) + func (c *Channel) Replace(value interface{}) + func (c *Channel) Send(value interface{}) + func (c *Channel) SendContext(ctx context.Context, value interface{}) error + func (c *Channel) SendOrFail(value interface{}) bool + type ConnWrapper struct + CloseCh *Channel + func (cw *ConnWrapper) Close() error + type FakeHTTPClient struct + Err error + RecvTimeout time.Duration + ReqChan *Channel + RespChan *Channel + func (fc *FakeHTTPClient) Do(req *http.Request) (*http.Response, error) + type ListenerWrapper struct + NewConnCh *Channel + func NewListenerWrapper(t *testing.T, lis net.Listener) *ListenerWrapper + func (l *ListenerWrapper) Accept() (net.Conn, error) + type PipeListener struct + func NewPipeListener() *PipeListener + func (p *PipeListener) Accept() (net.Conn, error) + func (p *PipeListener) Addr() net.Addr + func (p *PipeListener) Close() error + func (p *PipeListener) Dialer() func(string, time.Duration) (net.Conn, error) + type RestartableListener struct + func NewRestartableListener(l net.Listener) *RestartableListener + func (l *RestartableListener) Accept() (net.Conn, error) + func (l *RestartableListener) Addr() net.Addr + func (l *RestartableListener) Close() error + func (l *RestartableListener) Restart() + func (l *RestartableListener) Stop() + type TestClientConn struct + NewPickerCh chan balancer.Picker + NewStateCh chan connectivity.State + NewSubConnAddrsCh chan []resolver.Address + NewSubConnCh chan balancer.SubConn + RemoveSubConnCh chan balancer.SubConn + ResolveNowCh chan resolver.ResolveNowOptions + UpdateAddressesAddrsCh chan []resolver.Address + func NewTestClientConn(t *testing.T) *TestClientConn + func (tcc *TestClientConn) NewSubConn(a []resolver.Address, o balancer.NewSubConnOptions) (balancer.SubConn, error) + func (tcc *TestClientConn) RemoveSubConn(sc balancer.SubConn) + func (tcc *TestClientConn) ResolveNow(o resolver.ResolveNowOptions) + func (tcc *TestClientConn) Target() string + func (tcc *TestClientConn) UpdateAddresses(sc balancer.SubConn, addrs []resolver.Address) + func (tcc *TestClientConn) UpdateState(bs balancer.State) + func (tcc *TestClientConn) WaitForConnectivityState(ctx context.Context, want connectivity.State) error + func (tcc *TestClientConn) WaitForErrPicker(ctx context.Context) error + func (tcc *TestClientConn) WaitForPicker(ctx context.Context, f func(balancer.Picker) error) error + func (tcc *TestClientConn) WaitForPickerWithErr(ctx context.Context, want error) error + func (tcc *TestClientConn) WaitForRoundRobinPicker(ctx context.Context, want ...balancer.SubConn) error + type TestConstPicker struct + Err error + SC balancer.SubConn + func (tcp *TestConstPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) + type TestSubConn struct + ConnectCh chan struct{} + func (tsc *TestSubConn) Connect() + func (tsc *TestSubConn) GetOrBuildProducer(balancer.ProducerBuilder) (balancer.Producer, func()) + func (tsc *TestSubConn) String() string + func (tsc *TestSubConn) UpdateAddresses([]resolver.Address)