package conn

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

Index

Constants

const (
	Created = State(iota)
	Online
	Banned
	Offline
	Destroyed
)

Types

type Config

type Config interface {
	DialTimeout() time.Duration
	RequestTimeout() time.Duration
	OperationTimeout() time.Duration
	OperationCancelAfter() time.Duration
	StreamTimeout() time.Duration
	Trace() trace.Driver
	ConnectionTTL() time.Duration
	GrpcDialOptions() []grpc.DialOption
}

type Conn

type Conn interface {
	grpc.ClientConnInterface

	Endpoint() endpoint.Endpoint
	GetState() State
	SetState(context.Context, State) State
	Close(ctx context.Context) error
	Park(ctx context.Context) error
	TTL() <-chan time.Time
}

func New

func New(endpoint endpoint.Endpoint, config Config) Conn

type Pool

type Pool interface {
	closer.Closer

	Get(endpoint endpoint.Endpoint) Conn
	Pessimize(ctx context.Context, e endpoint.Endpoint) error
}

func NewPool

func NewPool(ctx context.Context, config Config) Pool

type PoolConfig

type PoolConfig interface {
	ConnectionTTL() time.Duration
	GrpcDialOptions() []grpc.DialOption
}

type State

type State int8

func (State) Code

func (s State) Code() int

func (State) IsValid

func (s State) IsValid() bool

func (State) String

func (s State) String() string

Source Files

config.go conn.go grpc_client_stream.go pool.go state.go

Version
v3.8.4
Published
Feb 4, 2022
Platform
js/wasm
Imports
17 packages
Last checked
22 seconds ago

Tools for package owners.