Documentation ¶
Index ¶
- Constants
- func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
- func IsOperationErrorAlreadyExistsError(err error) bool
- func IsOperationErrorNotFoundError(err error) bool
- func IsOperationErrorOverloaded(err error) bool
- func IsOperationErrorSchemeError(err error) bool
- func IsOperationErrorUnavailable(err error) bool
- func IsRatelimiterAcquireError(err error) bool
- func IsTimeoutError(err error) bool
- func IsTransportError(err error, codes ...grpcCodes.Code) bool
- func IsYdbError(err error) bool
- func IterateByIssues(err error, ...)
- func RegisterParser(param string, parser func(value string) ([]config.Option, error)) (err error)
- func ToRatelimiterAcquireError(err error) ratelimiter.AcquireError
- func WithRequestType(ctx context.Context, requestType string) context.Context
- func WithTraceID(ctx context.Context, traceID string) context.Context
- type Connection
- type Error
- type LoggerOption
- type Option
- func MergeOptions(opts ...Option) Option
- func With(options ...config.Option) Option
- func WithAccessTokenCredentials(accessToken string) Option
- func WithAnonymousCredentials() Option
- func WithBalancer(balancer balancer.Balancer) Option
- func WithCertificate(cert *x509.Certificate) Option
- func WithCertificatesFromFile(caFile string) Option
- func WithCertificatesFromPem(bytes []byte) Option
- func WithConnectionString(connectionString string) Option
- func WithConnectionTTL(ttl time.Duration) Option
- func WithCreateCredentialsFunc(createCredentials func(ctx context.Context) (credentials.Credentials, error)) Option
- func WithCredentials(c credentials.Credentials) Option
- func WithDatabase(database string) Option
- func WithDialTimeout(timeout time.Duration) Option
- func WithDiscoveryInterval(discoveryInterval time.Duration) Option
- func WithEndpoint(endpoint string) Option
- func WithInsecure() Option
- func WithLogger(details trace.Details, opts ...LoggerOption) Option
- func WithMinTLSVersion(minVersion uint16) Option
- func WithPanicCallback(cb func(e interface{})) Option
- func WithRatelimiterOptions(opts ...ratelimiterConfig.Option) Option
- func WithRequestsType(requestsType string) Option
- func WithSecure(secure bool) Option
- func WithSessionPoolCreateSessionTimeout(createSessionTimeout time.Duration) Option
- func WithSessionPoolDeleteTimeout(deleteTimeout time.Duration) Option
- func WithSessionPoolIdleThreshold(idleThreshold time.Duration) Option
- func WithSessionPoolKeepAliveMinSize(keepAliveMinSize int) Option
- func WithSessionPoolKeepAliveTimeout(keepAliveTimeout time.Duration) Option
- func WithSessionPoolSizeLimit(sizeLimit int) Option
- func WithTLSSInsecureSkipVerify() Option
- func WithTableConfigOption(option tableConfig.Option) Option
- func WithTraceCoordination(t trace.Coordination, opts ...trace.CoordinationComposeOption) Option
- func WithTraceDiscovery(t trace.Discovery, opts ...trace.DiscoveryComposeOption) Option
- func WithTraceDriver(trace trace.Driver, opts ...trace.DriverComposeOption) Option
- func WithTraceRatelimiter(t trace.Ratelimiter, opts ...trace.RatelimiterComposeOption) Option
- func WithTraceScheme(t trace.Scheme, opts ...trace.SchemeComposeOption) Option
- func WithTraceScripting(t trace.Scripting, opts ...trace.ScriptingComposeOption) Option
- func WithTraceTable(t trace.Table, opts ...trace.TableComposeOption) Option
- func WithUserAgent(userAgent string) Option
Constants ¶
const Version = meta.VersionMajor + "." + meta.VersionMinor + "." + meta.VersionPatch
Version alias for except cycle import
Variables ¶
This section is empty.
Functions ¶
func IsOperationError ¶
func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
func IsOperationErrorAlreadyExistsError ¶ added in v3.5.0
func IsOperationErrorNotFoundError ¶ added in v3.5.0
func IsOperationErrorOverloaded ¶ added in v3.5.0
func IsOperationErrorSchemeError ¶ added in v3.5.0
func IsOperationErrorUnavailable ¶ added in v3.5.0
func IsRatelimiterAcquireError ¶ added in v3.11.0
func IsTimeoutError ¶
func IsYdbError ¶ added in v3.4.2
func IterateByIssues ¶
func IterateByIssues(err error, it func(message string, code Ydb.StatusIds_StatusCode, severity uint32))
func RegisterParser ¶ added in v3.9.0
func ToRatelimiterAcquireError ¶ added in v3.11.0
func ToRatelimiterAcquireError(err error) ratelimiter.AcquireError
func WithRequestType ¶ added in v3.13.0
WithRequestType returns a copy of parent context with custom request type
Types ¶
type Connection ¶
type Connection interface { closer.Closer db.Info grpc.ClientConnInterface // Table returns table client Table() table.Client // Scheme returns scheme client Scheme() scheme.Client // Coordination returns coordination client Coordination() coordination.Client // Ratelimiter returns rate limiter client Ratelimiter() ratelimiter.Client // Discovery returns discovery client Discovery() discovery.Client // Scripting returns scripting client Scripting() scripting.Client // With returns Connection specified with custom options // Options provide options replacement for all clients taked from new Connection With(ctx context.Context, opts ...Option) (Connection, error) }
Connection interface provide access to YDB service clients Interface and list of clients may be changed in the future
type Error ¶ added in v3.4.2
func OperationError ¶ added in v3.16.9
func TransportError ¶ added in v3.16.9
type LoggerOption ¶ added in v3.5.3
func WithErrWriter ¶ added in v3.5.0
func WithErrWriter(err io.Writer) LoggerOption
func WithExternalLogger ¶ added in v3.5.0
func WithExternalLogger(external log.Logger) LoggerOption
func WithMinLevel ¶ added in v3.3.0
func WithMinLevel(minLevel log.Level) LoggerOption
func WithNamespace ¶ added in v3.3.0
func WithNamespace(namespace string) LoggerOption
func WithNoColor ¶ added in v3.3.0
func WithNoColor(b bool) LoggerOption
func WithOutWriter ¶ added in v3.5.0
func WithOutWriter(out io.Writer) LoggerOption
type Option ¶
func MergeOptions ¶ added in v3.5.1
func WithAnonymousCredentials ¶
func WithAnonymousCredentials() Option
func WithBalancer ¶ added in v3.6.0
func WithCertificate ¶
func WithCertificate(cert *x509.Certificate) Option
func WithCertificatesFromPem ¶
func WithConnectionString ¶
WithConnectionString accept connection string like 'grpc[s]://{endpoint}/?database={database}'
func WithConnectionTTL ¶ added in v3.7.0
WithConnectionTTL defines duration for parking idle connections Warning: if defined WithSessionPoolIdleThreshold - idleThreshold must be less than connectionTTL
func WithCreateCredentialsFunc ¶
func WithCreateCredentialsFunc(createCredentials func(ctx context.Context) (credentials.Credentials, error)) Option
func WithCredentials ¶
func WithCredentials(c credentials.Credentials) Option
WithCredentials in conjunction with Connection.With function prohibit reuse of conn pool. Thus, Connection.With will effectively create totally separate Connection.
func WithDatabase ¶ added in v3.2.1
func WithDialTimeout ¶
func WithDiscoveryInterval ¶
func WithEndpoint ¶ added in v3.2.1
func WithInsecure ¶ added in v3.8.6
func WithInsecure() Option
func WithLogger ¶ added in v3.3.0
func WithLogger(details trace.Details, opts ...LoggerOption) Option
func WithMinTLSVersion ¶ added in v3.9.1
func WithPanicCallback ¶ added in v3.17.0
func WithPanicCallback(cb func(e interface{})) Option
WithPanicCallback specified behavior on panic Warning: WithPanicCallback must be defined on start of all options (before `WithTrace{Driver,Table,Scheme,Scripting,Coordination,Ratelimiter}` and other options)
func WithRatelimiterOptions ¶ added in v3.11.0
func WithRatelimiterOptions(opts ...ratelimiterConfig.Option) Option
func WithRequestsType ¶ added in v3.13.0
func WithSecure ¶ added in v3.7.0
func WithSessionPoolIdleThreshold ¶
WithSessionPoolIdleThreshold defines keep-alive interval for idle sessions Warning: if defined WithConnectionTTL - idleThreshold must be less than connectionTTL
func WithTLSSInsecureSkipVerify ¶ added in v3.11.0
func WithTLSSInsecureSkipVerify() Option
func WithTableConfigOption ¶
func WithTableConfigOption(option tableConfig.Option) Option
func WithTraceCoordination ¶ added in v3.10.0
func WithTraceCoordination(t trace.Coordination, opts ...trace.CoordinationComposeOption) Option
WithTraceCoordination returns coordination trace option
func WithTraceDiscovery ¶ added in v3.10.0
func WithTraceDiscovery(t trace.Discovery, opts ...trace.DiscoveryComposeOption) Option
WithTraceDiscovery returns discovery trace option
func WithTraceDriver ¶
func WithTraceDriver(trace trace.Driver, opts ...trace.DriverComposeOption) Option
WithTraceDriver returns deadline which has associated Driver with it.
func WithTraceRatelimiter ¶ added in v3.10.0
func WithTraceRatelimiter(t trace.Ratelimiter, opts ...trace.RatelimiterComposeOption) Option
WithTraceRatelimiter returns ratelimiter trace option
func WithTraceScheme ¶ added in v3.10.0
func WithTraceScheme(t trace.Scheme, opts ...trace.SchemeComposeOption) Option
WithTraceScheme returns scheme trace option
func WithTraceScripting ¶ added in v3.10.0
func WithTraceScripting(t trace.Scripting, opts ...trace.ScriptingComposeOption) Option
WithTraceScripting scripting trace option
func WithTraceTable ¶
func WithTraceTable(t trace.Table, opts ...trace.TableComposeOption) Option
WithTraceTable returns table trace option