config

package
v3.20.3-rc0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultKeepaliveInterval contains default duration between grpc keepalive
	DefaultKeepaliveInterval    = 10 * time.Second
	MinKeepaliveInterval        = 10 * time.Second
	DefaultGRPCMsgSize          = 64 * 1024 * 1024 // 64MB
	DefaultGrpcConnectionPolicy = keepalive.ClientParameters{
		Time:                DefaultKeepaliveInterval,
		Timeout:             MinKeepaliveInterval,
		PermitWithoutStream: true,
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	config.Common
	// contains filtered or unexported fields
}

Config contains driver configuration.

func New

func New(opts ...Option) Config

func (Config) Balancer added in v3.6.0

func (c Config) Balancer() balancer.Balancer

Balancer is an optional configuration related to selected balancer. That is, some balancing methods allow to be configured.

func (Config) ConnectionTTL added in v3.7.0

func (c Config) ConnectionTTL() time.Duration

ConnectionTTL is a time to live of a connection If ConnectionTTL is zero then TTL is not used.

func (Config) Credentials

func (c Config) Credentials() credentials.Credentials

Credentials is an ydb client credentials. In most cases Credentials are required.

func (Config) Database

func (c Config) Database() string

Database is a required database name.

func (Config) DialTimeout

func (c Config) DialTimeout() time.Duration

DialTimeout is the maximum amount of time a dial will wait for a connect to complete.

If DialTimeout is zero then no timeout is used.

func (Config) Endpoint

func (c Config) Endpoint() string

Endpoint is a required starting endpoint for connect

func (Config) ExcludeGRPCCodesForPessimization added in v3.16.8

func (c Config) ExcludeGRPCCodesForPessimization() []grpcCodes.Code

ExcludeGRPCCodesForPessimization defines grpc codes for exclude its from pessimization trigger

func (Config) GrpcDialOptions added in v3.5.0

func (c Config) GrpcDialOptions() []grpc.DialOption

GrpcDialOptions is an custom client grpc dial options which will appends to default grpc dial options

func (Config) Meta added in v3.7.0

func (c Config) Meta() meta.Meta

Meta is an internal option which contains meta information about database connection

func (Config) RequestsType

func (c Config) RequestsType() string

RequestsType set an additional type hint to all requests. It is needed only for debug purposes and advanced cases.

func (Config) Secure

func (c Config) Secure() bool

Secure is an flag for secure connection

func (Config) TLSConfig

func (c Config) TLSConfig() *tls.Config

func (Config) Trace

func (c Config) Trace() trace.Driver

Trace contains driver tracing options.

func (Config) UseDNSResolver added in v3.16.0

func (c Config) UseDNSResolver() bool

UseDNSResolver is a flag about using dns-resolving or not

type Option

type Option func(c *Config)

func ExcludeGRPCCodesForPessimization added in v3.16.8

func ExcludeGRPCCodesForPessimization(codes ...grpcCodes.Code) Option

func WithBalancer added in v3.6.0

func WithBalancer(balancer balancer.Balancer) Option

func WithCertificate

func WithCertificate(certificate *x509.Certificate) Option

func WithConnectionTTL added in v3.7.0

func WithConnectionTTL(ttl time.Duration) Option

func WithCredentials

func WithCredentials(credentials credentials.Credentials) Option

func WithDatabase

func WithDatabase(database string) Option

func WithDialTimeout

func WithDialTimeout(timeout time.Duration) Option

func WithEndpoint

func WithEndpoint(endpoint string) Option

func WithGrpcOptions added in v3.5.0

func WithGrpcOptions(option ...grpc.DialOption) Option

func WithInternalDNSResolver added in v3.16.0

func WithInternalDNSResolver() Option

WithInternalDNSResolver disable dns-resolving before dialing If dns-resolving are disabled - dial used FQDN as address If dns-resolving are enabled - dial used IP-address

func WithMinTLSVersion added in v3.9.1

func WithMinTLSVersion(minVersion uint16) Option

func WithOperationCancelAfter

func WithOperationCancelAfter(operationCancelAfter time.Duration) Option

WithOperationCancelAfter sets 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.

func WithOperationTimeout

func WithOperationTimeout(operationTimeout time.Duration) Option

WithOperationTimeout defines 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.

func WithPanicCallback added in v3.21.0

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

WithPanicCallback applies panic callback to config

func WithRequestsType

func WithRequestsType(requestsType string) Option

func WithSecure

func WithSecure(secure bool) Option

func WithTLSSInsecureSkipVerify added in v3.11.0

func WithTLSSInsecureSkipVerify() Option

func WithTrace

func WithTrace(t trace.Driver, opts ...trace.DriverComposeOption) Option

func WithUserAgent added in v3.7.0

func WithUserAgent(userAgent string) Option

Jump to

Keyboard shortcuts

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