package mock
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/mock"
Index ¶
- type BalancerMock
- func Balancer() *BalancerMock
- func (s *BalancerMock) Create(conns []conn.Conn) balancer.Balancer
- func (s *BalancerMock) NeedRefresh(ctx context.Context) bool
- func (s *BalancerMock) Next(ctx context.Context, allowBanned bool) conn.Conn
- 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{}, opts ...grpc.CallOption) 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, opts ...grpc.CallOption) (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)
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) Create ¶
func (s *BalancerMock) Create(conns []conn.Conn) balancer.Balancer
func (*BalancerMock) NeedRefresh ¶
func (s *BalancerMock) NeedRefresh(ctx context.Context) bool
func (*BalancerMock) Next ¶
type ConnMock ¶
type ConnMock struct { AddrField string LocalDCField bool LocationField string NodeIdField uint32 State conn.State PingErr error }
func (*ConnMock) Endpoint ¶
func (*ConnMock) GetState ¶
func (*ConnMock) Invoke ¶
func (c *ConnMock) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error
func (*ConnMock) IsState ¶
func (*ConnMock) LastUsage ¶
func (*ConnMock) NewStream ¶
func (c *ConnMock) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
func (*ConnMock) Park ¶
func (*ConnMock) Ping ¶
func (*ConnMock) Release ¶
func (*ConnMock) SetState ¶
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)
Source Files ¶
- Version
- v3.24.1-rc0
- Published
- Apr 25, 2022
- Platform
- darwin/amd64
- Imports
- 6 packages
- Last checked
- 5 minutes ago –
Tools for package owners.