package config
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/query/config"
Index ¶
- Constants
- type Config
- func New(opts ...Option) *Config
- func (c *Config) LazyTx() bool
- func (c *Config) PoolLimit() int
- func (c *Config) PoolSessionUsageLimit() uint64
- func (c *Config) PoolSessionUsageTTL() time.Duration
- func (c *Config) SessionCreateTimeout() time.Duration
- func (c *Config) SessionDeleteTimeout() time.Duration
- func (c *Config) SessionIdleTimeToLive() time.Duration
- func (c *Config) Trace() *trace.Query
- type Option
- func With(config config.Common) Option
- func WithLazyTx(lazyTx bool) Option
- func WithPoolLimit(size int) Option
- func WithSessionCreateTimeout(createSessionTimeout time.Duration) Option
- func WithSessionDeleteTimeout(deleteTimeout time.Duration) Option
- func WithSessionIdleTimeToLive(idleTimeToLive time.Duration) Option
- func WithSessionPoolSessionUsageLimit[T interface{ uint64 | time.Duration }](limit T) Option
- func WithTrace(trace *trace.Query, opts ...trace.QueryComposeOption) Option
Constants ¶
const ( DefaultSessionDeleteTimeout = 500 * time.Millisecond DefaultSessionCreateTimeout = 500 * time.Millisecond DefaultPoolMaxSize = pool.DefaultLimit )
Types ¶
type Config ¶
func New ¶
func (*Config) LazyTx ¶
func (*Config) PoolLimit ¶
PoolLimit is an upper bound of pooled sessions. If PoolLimit is less than or equal to zero then the DefaultPoolMaxSize variable is used as a pool limit.
func (*Config) PoolSessionUsageLimit ¶
func (*Config) PoolSessionUsageTTL ¶
func (*Config) SessionCreateTimeout ¶
SessionCreateTimeout limits maximum time spent on Create session request
func (*Config) SessionDeleteTimeout ¶
SessionDeleteTimeout limits maximum time spent on Delete request
If SessionDeleteTimeout is less than or equal to zero then the DefaultSessionDeleteTimeout is used.
func (*Config) SessionIdleTimeToLive ¶
SessionIdleTimeToLive limits maximum time to live of idle session If idleTimeToLive is less than or equal to zero then sessions will not be closed by idle
func (*Config) Trace ¶
Trace defines trace over table client calls
type Option ¶
type Option func(*Config)
func With ¶
With applies common configuration params
func WithLazyTx ¶
func WithPoolLimit ¶
WithPoolLimit defines upper bound of pooled sessions. If poolLimit is less than or equal to zero then the DefaultPoolMaxSize variable is used as a poolLimit.
func WithSessionCreateTimeout ¶
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 ¶
WithSessionDeleteTimeout limits maximum time spent on Delete request If sessionDeleteTimeout is less than or equal to zero then the DefaultSessionDeleteTimeout is used.
func WithSessionIdleTimeToLive ¶
WithSessionIdleTimeToLive limits maximum time to live of idle session If idleTimeToLive is less than or equal to zero then sessions will not be closed by idle
func WithSessionPoolSessionUsageLimit ¶
WithSessionPoolSessionUsageLimit set pool session max usage: - if argument type is uint64 - WithSessionPoolSessionUsageLimit limits max usage count of pool session - if argument type is time.Duration - WithSessionPoolSessionUsageLimit limits max time to live of pool session
func WithTrace ¶
func WithTrace(trace *trace.Query, opts ...trace.QueryComposeOption) Option
WithTrace appends table trace to early defined traces
Source Files ¶
- Version
- v3.108.0 (latest)
- Published
- Apr 21, 2025
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 13 minutes ago –
Tools for package owners.