Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) Balancer() *balancerConfig.Config
- func (c *Config) ConnectionTTL() time.Duration
- func (c *Config) Credentials() credentials.Credentials
- func (c *Config) Database() string
- func (c *Config) DialTimeout() time.Duration
- func (c *Config) Endpoint() string
- func (c *Config) ExcludeGRPCCodesForPessimization() []grpcCodes.Code
- func (c *Config) GrpcDialOptions() []grpc.DialOption
- func (c *Config) Meta() *meta.Meta
- func (c *Config) Secure() bool
- func (c *Config) TLSConfig() *tls.Config
- func (c *Config) Trace() *trace.Driver
- func (c *Config) With(opts ...Option) *Config
- type Option
- func ExcludeGRPCCodesForPessimization(codes ...grpcCodes.Code) Option
- func WithBalancer(balancer *balancerConfig.Config) Option
- func WithCertificate(certificate *x509.Certificate) Option
- func WithConnectionTTL(ttl time.Duration) Option
- func WithCredentials(credentials credentials.Credentials) Option
- func WithDatabase(database string) Option
- func WithDialTimeout(timeout time.Duration) Option
- func WithEndpoint(endpoint string) Option
- func WithGrpcOptions(option ...grpc.DialOption) Option
- func WithInternalDNSResolver() Optiondeprecated
- func WithMinTLSVersion(minVersion uint16) Option
- func WithNoAutoRetry() Option
- func WithOperationCancelAfter(operationCancelAfter time.Duration) Option
- func WithOperationTimeout(operationTimeout time.Duration) Option
- func WithPanicCallback(panicCallback func(e interface{})) Option
- func WithRequestsType(requestsType string) Option
- func WithSecure(secure bool) Option
- func WithTLSConfig(tlsConfig *tls.Config) Option
- func WithTLSSInsecureSkipVerify() Option
- func WithTrace(t trace.Driver, opts ...trace.DriverComposeOption) Option
- func WithUserAgent(userAgent string) Option
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultKeepaliveInterval contains default duration between grpc keepalive DefaultKeepaliveInterval = 10 * time.Second MinKeepaliveInterval = 10 * time.Second DefaultDialTimeout = 5 * time.Second DefaultGRPCMsgSize = 64 * 1024 * 1024 // 64MB DefaultGrpcConnectionPolicy = keepalive.ClientParameters{ Time: DefaultKeepaliveInterval, Timeout: MinKeepaliveInterval, PermitWithoutStream: true, } )
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config contains driver configuration.
func (*Config) Balancer ¶ added in v3.6.0
func (c *Config) Balancer() *balancerConfig.Config
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
ConnectionTTL defines interval for parking grpc connections.
If ConnectionTTL is zero - connections are not park.
func (*Config) Credentials ¶
func (c *Config) Credentials() credentials.Credentials
func (*Config) DialTimeout ¶
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) ExcludeGRPCCodesForPessimization ¶ added in v3.16.8
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 reports about used grpc dialing options
type Option ¶
type Option func(c *Config)
func ExcludeGRPCCodesForPessimization ¶ added in v3.16.8
func WithBalancer ¶ added in v3.6.0
func WithBalancer(balancer *balancerConfig.Config) Option
func WithCertificate ¶
func WithCertificate(certificate *x509.Certificate) Option
WithCertificate appends certificate to TLS config root certificates
func WithConnectionTTL ¶ added in v3.7.0
func WithCredentials ¶
func WithCredentials(credentials credentials.Credentials) Option
func WithDatabase ¶
func WithDialTimeout ¶
func WithEndpoint ¶
func WithGrpcOptions ¶ added in v3.5.0
func WithGrpcOptions(option ...grpc.DialOption) Option
WithGrpcOptions appends custom grpc dial options to defaults
func WithInternalDNSResolver
deprecated
added in
v3.16.0
func WithInternalDNSResolver() Option
WithInternalDNSResolver
Deprecated: always used internal dns-resolver
func WithMinTLSVersion ¶ added in v3.9.1
WithMinTLSVersion applies minimum TLS version that is acceptable.
func WithNoAutoRetry ¶ added in v3.24.0
func WithNoAutoRetry() Option
WithNoAutoRetry disable auto-retry calls from YDB sub-clients
func WithOperationCancelAfter ¶
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 ¶
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 WithSecure ¶
WithSecure changes secure connection flag.
Warning: if secure is false - TLS config options has no effect.
func WithTLSConfig ¶ added in v3.23.0
WithTLSConfig replaces older TLS config
Warning: all early changes of TLS config will be lost
func WithTLSSInsecureSkipVerify ¶ added in v3.11.0
func WithTLSSInsecureSkipVerify() Option
WithTLSSInsecureSkipVerify applies InsecureSkipVerify flag to TLS config