package config
import "github.com/ydb-platform/ydb-go-sdk/v3/config"
Index ¶
- Variables
- type Config
- type Option
- func ExcludeGRPCCodesForPessimization(codes ...grpcCodes.Code) Option
- func WithBalancer(balancer balancer.Balancer) 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() Option
- func WithMinTLSVersion(minVersion uint16) Option
- func WithOperationCancelAfter(operationCancelAfter time.Duration) Option
- func WithOperationTimeout(operationTimeout time.Duration) Option
- func WithRequestsType(requestsType string) Option
- func WithSecure(secure bool) Option
- func WithTLSSInsecureSkipVerify() Option
- func WithTrace(trace trace.Driver) Option
- func WithUserAgent(userAgent string) Option
Variables ¶
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, } )
Types ¶
type Config ¶
type Config interface { // Endpoint is a required starting endpoint for connect Endpoint() string // Database is a required database name. Database() string // Secure is an flag for secure connection Secure() bool // Credentials is an ydb client credentials. // In most cases Credentials are required. Credentials() credentials.Credentials // Trace contains driver tracing options. Trace() trace.Driver // 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 // Balancer is an optional configuration related to selected balancer. // That is, some balancing methods allow to be configured. Balancer() balancer.Balancer // RequestsType set an additional type hint to all requests. // It is needed only for debug purposes and advanced cases. RequestsType() string // 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. DialTimeout() time.Duration // GrpcDialOptions is an custom client grpc dial options which will appends to // default grpc dial options GrpcDialOptions() []grpc.DialOption // ConnectionTTL is a time to live of a connection // If ConnectionTTL is zero then TTL is not used. ConnectionTTL() time.Duration // Meta is an option which contains meta information about database connection Meta() meta.Meta // UseDNSResolver is a flag about using dns-resolving or not UseDNSResolver() bool // ExcludeGRPCCodesForPessimization defines grpc codes for exclude its from pessimization trigger ExcludeGRPCCodesForPessimization() []grpcCodes.Code }
Config contains driver configuration options.
func New ¶
type Option ¶
type Option func(c *config)
func ExcludeGRPCCodesForPessimization ¶
func WithBalancer ¶
func WithCertificate ¶
func WithCertificate(certificate *x509.Certificate) Option
func WithConnectionTTL ¶
func WithCredentials ¶
func WithCredentials(credentials credentials.Credentials) Option
func WithDatabase ¶
func WithDialTimeout ¶
func WithEndpoint ¶
func WithGrpcOptions ¶
func WithGrpcOptions(option ...grpc.DialOption) Option
func WithInternalDNSResolver ¶
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 ¶
func WithOperationCancelAfter ¶
func WithOperationTimeout ¶
func WithRequestsType ¶
func WithSecure ¶
func WithTLSSInsecureSkipVerify ¶
func WithTLSSInsecureSkipVerify() Option
func WithTrace ¶
func WithUserAgent ¶
Source Files ¶
config.go grpc_credentials.go keepalive.go
- Version
- v3.16.9
- Published
- Mar 23, 2022
- Platform
- windows/amd64
- Imports
- 17 packages
- Last checked
- 11 seconds ago –
Tools for package owners.