package config

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

Index

Types

type Config

type Config interface {
	// OperationTimeout is the maximum amount of time a YDB server will process
	// an operation. After timeout exceeds YDB will try to cancel operation and
	// regardless of the cancellation appropriate error will be returned to
	// the client.
	// If OperationTimeout is zero then no timeout is used.
	OperationTimeout() time.Duration

	// OperationCancelAfter is the maximum amount of time a YDB server will process an
	// operation. After timeout exceeds YDB will try to cancel operation and if
	// it succeeds appropriate error will be returned to the client; otherwise
	// processing will be continued.
	// If OperationCancelAfter is zero then no timeout is used.
	OperationCancelAfter() time.Duration

	// Trace defines trace over scheme client calls
	Trace() trace.Scheme

	// PanicCallback returns user-defined panic callback
	// If nil - panic callback not defined
	PanicCallback() func(e interface{})
}

func New

func New(opts ...Option) Config

type Option

type Option func(c *config)

func WithOperationCancelAfter

func WithOperationCancelAfter(operationCancelAfter time.Duration) Option

func WithOperationTimeout

func WithOperationTimeout(operationTimeout time.Duration) Option

func WithPanicCallback

func WithPanicCallback(cb func(e interface{})) Option

func WithTrace

func WithTrace(trace trace.Scheme, opts ...trace.SchemeComposeOption) Option

Source Files

config.go

Version
v3.18.3
Published
Apr 7, 2022
Platform
linux/amd64
Imports
2 packages
Last checked
1 minute ago

Tools for package owners.