config

package
v3.57.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPoolDeleteTimeout        = 500 * time.Millisecond
	DefaultPoolCreateSessionTimeout = 5 * time.Second
	DefaultPoolMaxSize              = 50
)

Variables

This section is empty.

Functions

This section is empty.

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) CreateSessionTimeout

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

CreateSessionTimeout limits maximum time spent on Create session request

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 DefaultPoolDeleteTimeout 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) 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 WithCreateSessionTimeout

func WithCreateSessionTimeout(createSessionTimeout time.Duration) Option

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

func WithDeleteTimeout(deleteTimeout time.Duration) Option

WithDeleteTimeout limits maximum time spent on Delete request If deleteTimeout is less than or equal to zero then the DefaultPoolDeleteTimeout is used.

func WithSizeLimit

func WithSizeLimit(sizeLimit int) Option

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

func WithTrace added in v3.57.1

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

WithTrace appends table trace to early defined traces

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL