package conn

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

Index

Constants

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

Variables

var (
	// ErrOperationNotReady specified error when operation is not ready
	ErrOperationNotReady = fmt.Errorf("operation is not ready yet")
)

nolint:gofumpt nolint:nolintlint

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
	Meta() meta.Meta
	UseDNSResolver() bool
}

type Conn

type Conn interface {
	grpc.ClientConnInterface

	Endpoint() endpoint.Endpoint

	LastUsage() time.Time

	IsState(states ...State) bool
	GetState() State
	SetState(State) State

	Release(ctx context.Context)
}

func New

func New(e endpoint.Endpoint, config Config, opts ...option) Conn

type Creator

type Creator interface {
	Create(endpoint endpoint.Endpoint) Conn // creates new detached conn applying pool config
}

type Getter

type Getter interface {
	Get(endpoint endpoint.Endpoint) Conn
}

type Pessimizer

type Pessimizer interface {
	Pessimize(ctx context.Context, cc Conn, cause error)
}

type Pool

type Pool interface {
	Creator
	Getter
	Taker
	Releaser
	Pessimizer
}

func NewPool

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

type PoolConfig

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

type Releaser

type Releaser interface {
	Release(ctx context.Context) error
}

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

type Taker

type Taker interface {
	Take(ctx context.Context) error
}

Source Files

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

Version
v3.16.4
Published
Mar 22, 2022
Platform
linux/amd64
Imports
19 packages
Last checked
1 minute ago

Tools for package owners.