Documentation ¶
Index ¶
- Constants
- type Config
- func (c *Config) LazyTx() bool
- func (c *Config) PoolLimit() int
- func (c *Config) PoolSessionUsageLimit() uint64
- 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 WithPoolSessionUsageLimit(sessionUsageLimit uint64) Option
- func WithSessionCreateTimeout(createSessionTimeout time.Duration) Option
- func WithSessionDeleteTimeout(deleteTimeout time.Duration) Option
- func WithSessionIdleTimeToLive(idleTimeToLive time.Duration) Option
- func WithTrace(trace *trace.Query, opts ...trace.QueryComposeOption) Option
Constants ¶
const ( DefaultSessionDeleteTimeout = 500 * time.Millisecond DefaultSessionCreateTimeout = 500 * time.Millisecond DefaultPoolMaxSize = pool.DefaultLimit )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
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) 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
type Option ¶
type Option func(*Config)
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