package config

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

Index

Constants

const (
	DefaultSessionDeleteTimeout = 500 * time.Millisecond
	DefaultSessionCreateTimeout = 5 * time.Second
	DefaultPoolMinSize          = pool.DefaultMinSize
	DefaultPoolMaxSize          = pool.DefaultMaxSize
	DefaultPoolProducersCount   = pool.DefaultProducersCount
)

Types

type Config

type Config struct {
	config.Common
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Config

func (*Config) Clock

func (c *Config) Clock() clockwork.Clock

Clock defines clock

func (*Config) DeleteTimeout

func (c *Config) DeleteTimeout() time.Duration

DeleteTimeout limits maximum time spent on Delete request

If DeleteTimeout is less than or equal to zero then the DefaultSessionDeleteTimeout is used.

func (*Config) PoolMaxSize

func (c *Config) PoolMaxSize() int

PoolMaxSize is an upper bound of pooled sessions. If PoolMaxSize is less than or equal to zero then the DefaultPoolMaxSize variable is used as a limit.

func (*Config) PoolMinSize

func (c *Config) PoolMinSize() int

func (*Config) PoolProducersCount

func (c *Config) PoolProducersCount() int

func (*Config) SessionCreateTimeout

func (c *Config) SessionCreateTimeout() time.Duration

SessionCreateTimeout limits maximum time spent on Create session request

func (*Config) Trace

func (c *Config) Trace() *trace.Query

Trace defines trace over table client calls

type Option

type Option func(*Config)

func With

func With(config config.Common) Option

With applies common configuration params

func WithPoolMaxSize

func WithPoolMaxSize(size int) Option

WithPoolMaxSize defines upper bound of pooled sessions. If maxSize is less than or equal to zero then the DefaultPoolMaxSize variable is used as a limit.

func WithPoolMinSize

func WithPoolMinSize(size int) Option

func WithPoolProducersCount

func WithPoolProducersCount(count int) Option

func WithSessionCreateTimeout

func WithSessionCreateTimeout(createSessionTimeout time.Duration) Option

WithSessionCreateTimeout limits maximum time spent on Create session request If sessionCreateTimeout is less than or equal to zero then no used timeout on create session request

func WithSessionDeleteTimeout

func WithSessionDeleteTimeout(deleteTimeout time.Duration) Option

WithSessionDeleteTimeout limits maximum time spent on Delete request If sessionDeleteTimeout is less than or equal to zero then the DefaultSessionDeleteTimeout is used.

func WithTrace

func WithTrace(trace *trace.Query, opts ...trace.QueryComposeOption) Option

WithTrace appends table trace to early defined traces

Source Files

config.go options.go

Version
v3.58.2
Published
Mar 18, 2024
Platform
linux/amd64
Imports
5 packages
Last checked
28 minutes ago

Tools for package owners.