package config
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
Index ¶
- Constants
- type Config
- func New(opts ...Option) *Config
- func (c *Config) Clock() clockwork.Clock
- func (c *Config) CreateSessionTimeout() time.Duration
- func (c *Config) DeleteTimeout() time.Duration
- func (c *Config) ExecuteDataQueryOverQueryService() bool
- func (c *Config) IdleKeepAliveThreshold() int
- func (c *Config) IdleThreshold() time.Duration
- func (c *Config) IgnoreTruncated() bool
- func (c *Config) KeepAliveMinSize() int
- func (c *Config) KeepAliveTimeout() time.Duration
- func (c *Config) SessionUsageLimit() uint64
- func (c *Config) SessionUsageTTL() time.Duration
- func (c *Config) SizeLimit() int
- func (c *Config) Trace() *trace.Table
- func (c *Config) UseQuerySession() bool
- type Option
- func ExecuteDataQueryOverQueryService(b bool) Option
- func UseQuerySession(b bool) Option
- func With(config config.Common) Option
- func WithClock(clock clockwork.Clock) Option
- func WithCreateSessionTimeout(createSessionTimeout time.Duration) Option
- func WithDeleteTimeout(deleteTimeout time.Duration) Option
- func WithIdleKeepAliveThreshold(idleKeepAliveThreshold int) Option
- func WithIdleThreshold(idleThreshold time.Duration) Option
- func WithIgnoreTruncated() Option
- func WithKeepAliveMinSize(keepAliveMinSize int) Option
- func WithKeepAliveTimeout(keepAliveTimeout time.Duration) Option
- func WithSessionPoolSessionUsageLimit[T interface{ uint64 | time.Duration }](limit T) Option
- func WithSizeLimit(sizeLimit int) Option
- func WithTrace(trace *trace.Table, opts ...trace.TableComposeOption) Option
Constants ¶
const ( DefaultSessionPoolDeleteTimeout = 500 * time.Millisecond DefaultSessionPoolCreateSessionTimeout = 5 * time.Second DefaultSessionPoolSizeLimit = 50 DefaultSessionPoolIdleThreshold = 5 * time.Minute // Deprecated: table client do not supports background session keep-aliving now. // Will be removed after Oct 2024. // Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated DefaultKeepAliveMinSize = 10 // Deprecated: table client do not supports background session keep-aliving now. // Will be removed after Oct 2024. // Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated DefaultIdleKeepAliveThreshold = 2 // Deprecated: table client do not supports background session keep-aliving now. // Will be removed after Oct 2024. // Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated DefaultSessionPoolKeepAliveTimeout = 500 * time.Millisecond )
Types ¶
type Config ¶
Config is a configuration of table client
func New ¶
func (*Config) Clock ¶
Clock defines clock
func (*Config) CreateSessionTimeout ¶
CreateSessionTimeout limits maximum time spent on Create session request
func (*Config) DeleteTimeout ¶
DeleteTimeout limits maximum time spent on Delete request
If DeleteTimeout is less than or equal to zero then the DefaultSessionPoolDeleteTimeout is used.
func (*Config) ExecuteDataQueryOverQueryService ¶
ExecuteDataQueryOverQueryService specifies behavior on execute handle
func (*Config) IdleKeepAliveThreshold ¶
IdleKeepAliveThreshold is a number of keepAlive messages to call before the session is removed if it is an excess session (see KeepAliveMinSize) This means that session will be deleted after the expiration of lifetime = IdleThreshold * IdleKeepAliveThreshold If IdleKeepAliveThreshold is less than zero then it will be treated as infinite and no sessions will be removed ever. If IdleKeepAliveThreshold is equal to zero, it will be set to DefaultIdleKeepAliveThreshold
Deprecated: table client do not supports background session keep-aliving now. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func (*Config) IdleThreshold ¶
IdleThreshold is a maximum duration between any activity within session. If this threshold reached, idle session will be closed
If IdleThreshold is less than zero then there is no idle limit. If IdleThreshold is zero, then the DefaultSessionPoolIdleThreshold value is used.
func (*Config) IgnoreTruncated ¶
IgnoreTruncated specifies behavior on truncated flag
func (*Config) KeepAliveMinSize ¶
KeepAliveMinSize is a lower bound for sessions in the pool. If there are more sessions open, then the excess idle ones will be closed and removed after IdleKeepAliveThreshold is reached for each of them. If KeepAliveMinSize is less than zero, then no sessions will be preserved If KeepAliveMinSize is zero, the DefaultKeepAliveMinSize is used
Deprecated: table client do not supports background session keep-aliving now. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func (*Config) KeepAliveTimeout ¶
KeepAliveTimeout limits maximum time spent on KeepAlive request If KeepAliveTimeout is less than or equal to zero then the DefaultSessionPoolKeepAliveTimeout is used.
Deprecated: table client do not supports background session keep-aliving now. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func (*Config) SessionUsageLimit ¶
func (*Config) SessionUsageTTL ¶
func (*Config) SizeLimit ¶
SizeLimit is an upper bound of pooled sessions. If SizeLimit is less than or equal to zero then the DefaultSessionPoolSizeLimit variable is used as a limit.
func (*Config) Trace ¶
Trace defines trace over table client calls
func (*Config) UseQuerySession ¶
UseQuerySession specifies behavior on create/delete session
type Option ¶
type Option func(*Config)
func ExecuteDataQueryOverQueryService ¶
ExecuteDataQueryOverQueryService overrides Execute handle with query service execute with materialized result
func UseQuerySession ¶
UseQuerySession creates session using query service client
func With ¶
With applies common configuration params
func WithClock ¶
WithClock replaces default clock
func WithCreateSessionTimeout ¶
WithCreateSessionTimeout limits maximum time spent on Create session request If createSessionTimeout is less than or equal to zero then no used timeout on create session request
func WithDeleteTimeout ¶
WithDeleteTimeout limits maximum time spent on Delete request If deleteTimeout is less than or equal to zero then the DefaultSessionPoolDeleteTimeout is used.
func WithIdleKeepAliveThreshold ¶
WithIdleKeepAliveThreshold defines number of keepAlive messages to call before the session is removed if it is an excess session (see KeepAliveMinSize) This means that session will be deleted after the expiration of lifetime = IdleThreshold * IdleKeepAliveThreshold If IdleKeepAliveThreshold is less than zero then it will be treated as infinite and no sessions will be removed ever. If IdleKeepAliveThreshold is equal to zero, it will be set to DefaultIdleKeepAliveThreshold
Deprecated: table client do not supports background session keep-aliving now. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func WithIdleThreshold ¶
WithIdleThreshold sets maximum duration between any activity within session. If this threshold reached, session will be closed.
If idleThreshold is less than zero then there is no idle limit. If idleThreshold is zero, then the DefaultSessionPoolIdleThreshold value is used.
func WithIgnoreTruncated ¶
func WithIgnoreTruncated() Option
WithIgnoreTruncated disables errors on truncated flag
func WithKeepAliveMinSize ¶
WithKeepAliveMinSize defines lower bound for sessions in the pool. If there are more sessions open, then the excess idle ones will be closed and removed after IdleKeepAliveThreshold is reached for each of them. If keepAliveMinSize is less than zero, then no sessions will be preserved If keepAliveMinSize is zero, the DefaultKeepAliveMinSize is used
Deprecated: table client do not supports background session keep-aliving now. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func WithKeepAliveTimeout ¶
WithKeepAliveTimeout limits maximum time spent on KeepAlive request If keepAliveTimeout is less than or equal to zero then the DefaultSessionPoolKeepAliveTimeout is used.
Deprecated: table client do not supports background session keep-aliving now. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
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 WithSizeLimit ¶
WithSizeLimit defines upper bound of pooled sessions. If poolLimit is less than or equal to zero then the DefaultSessionPoolSizeLimit variable is used as a limit.
func WithTrace ¶
func WithTrace(trace *trace.Table, opts ...trace.TableComposeOption) 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.