package mock

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/mock"

Index

Types

type Conn

type Conn struct {
	PingErr       error
	AddrField     string
	LocationField string
	NodeIDField   uint32
	State         conn.State
	LocalDCField  bool
}

func (*Conn) Endpoint

func (c *Conn) Endpoint() endpoint.Endpoint

func (*Conn) GetState

func (c *Conn) GetState() conn.State

func (*Conn) Invoke

func (c *Conn) Invoke(
	ctx context.Context,
	method string,
	args interface{},
	reply interface{},
	opts ...grpc.CallOption,
) error

func (*Conn) IsState

func (c *Conn) IsState(states ...conn.State) bool

func (*Conn) LastUsage

func (c *Conn) LastUsage() time.Time

func (*Conn) NewStream

func (c *Conn) NewStream(ctx context.Context,
	desc *grpc.StreamDesc, method string,
	opts ...grpc.CallOption,
) (grpc.ClientStream, error)

func (*Conn) Park

func (c *Conn) Park(ctx context.Context) (err error)

func (*Conn) Ping

func (c *Conn) Ping(ctx context.Context) error

func (*Conn) SetState

func (c *Conn) SetState(ctx context.Context, state conn.State) conn.State

func (*Conn) Unban

func (c *Conn) Unban(ctx context.Context) conn.State

type Endpoint

type Endpoint struct {
	AddrField     string
	LocationField string
	NodeIDField   uint32
	LocalDCField  bool
}

func (*Endpoint) Address

func (e *Endpoint) Address() string

func (*Endpoint) Choose

func (e *Endpoint) Choose(bool)

func (*Endpoint) Copy

func (e *Endpoint) Copy() endpoint.Endpoint

func (*Endpoint) LastUpdated

func (e *Endpoint) LastUpdated() time.Time

func (*Endpoint) LoadFactor

func (e *Endpoint) LoadFactor() float32

func (*Endpoint) LocalDC

func (e *Endpoint) LocalDC() bool

Deprecated: LocalDC check "local" by compare endpoint location with discovery "selflocation" field. It work good only if connection url always point to local dc. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated

func (*Endpoint) Location

func (e *Endpoint) Location() string

func (*Endpoint) NodeID

func (e *Endpoint) NodeID() uint32

func (*Endpoint) OverrideHost

func (e *Endpoint) OverrideHost() string

func (*Endpoint) String

func (e *Endpoint) String() string

func (*Endpoint) Touch

func (e *Endpoint) Touch(opts ...endpoint.Option)

Source Files

conn.go

Version
v3.99.10
Published
Feb 12, 2025
Platform
js/wasm
Imports
5 packages
Last checked
9 minutes ago

Tools for package owners.