package conn

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

Index

Constants

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

Functions

func WithoutWrapping

func WithoutWrapping(ctx context.Context) context.Context

Types

type Config

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

type Conn

type Conn interface {
	grpc.ClientConnInterface

	Endpoint() endpoint.Endpoint

	IsState(states ...State) bool
	GetState() State
	SetState(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, opts ...option) Conn

type Pessimizer

type Pessimizer interface {
	Pessimize(ctx context.Context, e endpoint.Endpoint) error
}

type Pool

type Pool interface {
	closer.Closer
	Pessimizer
	PoolGetter
}

func NewPool

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

type PoolConfig

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

type PoolGetter

type PoolGetter interface {
	GetConn(endpoint endpoint.Endpoint) Conn
}

type PoolGetterCloser

type PoolGetterCloser interface {
	PoolGetter
	closer.Closer
}

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 context.go grpc_client_stream.go pool.go state.go

Version
v3.12.0
Published
Mar 5, 2022
Platform
linux/amd64
Imports
16 packages
Last checked
6 minutes ago

Tools for package owners.