Documentation ¶
Index ¶
- type BalancerMock
- type ConnMock
- func (c *ConnMock) Endpoint() endpoint.Endpoint
- func (c *ConnMock) GetState() conn.State
- func (c *ConnMock) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, ...) error
- func (c *ConnMock) IsState(states ...conn.State) bool
- func (c *ConnMock) LastUsage() time.Time
- func (c *ConnMock) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, ...) (grpc.ClientStream, error)
- func (c *ConnMock) Park(ctx context.Context) (err error)
- func (c *ConnMock) Ping(ctx context.Context) error
- func (c *ConnMock) Release(ctx context.Context) error
- func (c *ConnMock) SetState(state conn.State) conn.State
- type EndpointMock
- func (e *EndpointMock) Address() string
- func (e *EndpointMock) Copy() endpoint.Endpoint
- func (e *EndpointMock) LastUpdated() time.Time
- func (e *EndpointMock) LoadFactor() float32
- func (e *EndpointMock) LocalDC() bool
- func (e *EndpointMock) Location() string
- func (e *EndpointMock) NodeID() uint32
- func (e *EndpointMock) String() string
- func (e *EndpointMock) Touch(opts ...endpoint.Option)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalancerMock ¶
type BalancerMock struct { OnNext func(ctx context.Context, allowBanned bool) conn.Conn OnCreate func(conns []conn.Conn) balancer.Balancer OnNeedRefresh func(ctx context.Context) bool }
func Balancer ¶
func Balancer() *BalancerMock
func (*BalancerMock) NeedRefresh ¶
func (s *BalancerMock) NeedRefresh(ctx context.Context) bool
type ConnMock ¶
type ConnMock struct { AddrField string LocalDCField bool LocationField string NodeIdField uint32 State conn.State PingErr error }
func (*ConnMock) NewStream ¶
func (c *ConnMock) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
type EndpointMock ¶
type EndpointMock struct { AddrField string LocalDCField bool LocationField string NodeIdField uint32 }
func (*EndpointMock) Address ¶
func (e *EndpointMock) Address() string
func (*EndpointMock) Copy ¶
func (e *EndpointMock) Copy() endpoint.Endpoint
func (*EndpointMock) LastUpdated ¶
func (e *EndpointMock) LastUpdated() time.Time
func (*EndpointMock) LoadFactor ¶
func (e *EndpointMock) LoadFactor() float32
func (*EndpointMock) LocalDC ¶
func (e *EndpointMock) LocalDC() bool
func (*EndpointMock) Location ¶
func (e *EndpointMock) Location() string
func (*EndpointMock) NodeID ¶
func (e *EndpointMock) NodeID() uint32
func (*EndpointMock) String ¶
func (e *EndpointMock) String() string
func (*EndpointMock) Touch ¶
func (e *EndpointMock) Touch(opts ...endpoint.Option)
Click to show internal directories.
Click to hide internal directories.