package ydb
import "github.com/ydb-platform/ydb-go-sdk/v3"
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, it func(message string, code Ydb.StatusIds_StatusCode, severity uint32))
- 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
- func WithErrWriter(err io.Writer) LoggerOption
- func WithExternalLogger(external log.Logger) LoggerOption
- func WithMinLevel(minLevel log.Level) LoggerOption
- func WithNamespace(namespace string) LoggerOption
- func WithNoColor(b bool) LoggerOption
- func WithOutWriter(out io.Writer) 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 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(trace trace.Coordination) Option
- func WithTraceDiscovery(trace trace.Discovery) Option
- func WithTraceDriver(trace trace.Driver) Option
- func WithTraceRatelimiter(trace trace.Ratelimiter) Option
- func WithTraceScheme(trace trace.Scheme) Option
- func WithTraceScripting(trace trace.Scripting) Option
- func WithTraceTable(trace trace.Table) Option
- func WithUserAgent(userAgent string) Option
Constants ¶
const Version = meta.VersionMajor + "." + meta.VersionMinor + "." + meta.VersionPatch
Version alias for except cycle import
Functions ¶
func IsOperationError ¶
func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
func IsOperationErrorAlreadyExistsError ¶
func IsOperationErrorNotFoundError ¶
func IsOperationErrorOverloaded ¶
func IsOperationErrorSchemeError ¶
func IsOperationErrorUnavailable ¶
func IsRatelimiterAcquireError ¶
func IsTimeoutError ¶
func IsTransportError ¶
func IsYdbError ¶
func IterateByIssues ¶
func IterateByIssues(err error, it func(message string, code Ydb.StatusIds_StatusCode, severity uint32))
func RegisterParser ¶
func ToRatelimiterAcquireError ¶
func ToRatelimiterAcquireError(err error) ratelimiter.AcquireError
func WithRequestType ¶
WithRequestType returns a copy of parent context with custom request type
func WithTraceID ¶
WithTraceID returns a copy of parent context with traceID
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
func New ¶
func New(ctx context.Context, opts ...Option) (_ Connection, err error)
New connects to name and return name runtime holder
type Error ¶
func OperationError ¶
func TransportError ¶
type LoggerOption ¶
func WithErrWriter ¶
func WithErrWriter(err io.Writer) LoggerOption
func WithExternalLogger ¶
func WithExternalLogger(external log.Logger) LoggerOption
func WithMinLevel ¶
func WithMinLevel(minLevel log.Level) LoggerOption
func WithNamespace ¶
func WithNamespace(namespace string) LoggerOption
func WithNoColor ¶
func WithNoColor(b bool) LoggerOption
func WithOutWriter ¶
func WithOutWriter(out io.Writer) LoggerOption
type Option ¶
func MergeOptions ¶
func With ¶
func WithAccessTokenCredentials ¶
func WithAnonymousCredentials ¶
func WithAnonymousCredentials() Option
func WithBalancer ¶
func WithCertificate ¶
func WithCertificate(cert *x509.Certificate) Option
func WithCertificatesFromFile ¶
func WithCertificatesFromPem ¶
func WithConnectionString ¶
WithConnectionString accept connection string like 'grpc[s]://{endpoint}/?database={database}'
func WithConnectionTTL ¶
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 ¶
func WithDialTimeout ¶
func WithDiscoveryInterval ¶
func WithEndpoint ¶
func WithInsecure ¶
func WithInsecure() Option
func WithLogger ¶
func WithLogger(details trace.Details, opts ...LoggerOption) Option
func WithMinTLSVersion ¶
func WithRatelimiterOptions ¶
func WithRatelimiterOptions(opts ...ratelimiterConfig.Option) Option
func WithRequestsType ¶
func WithSecure ¶
func WithSessionPoolCreateSessionTimeout ¶
func WithSessionPoolDeleteTimeout ¶
func WithSessionPoolIdleThreshold ¶
WithSessionPoolIdleThreshold defines keep-alive interval for idle sessions Warning: if defined WithConnectionTTL - idleThreshold must be less than connectionTTL
func WithSessionPoolKeepAliveMinSize ¶
func WithSessionPoolKeepAliveTimeout ¶
func WithSessionPoolSizeLimit ¶
func WithTLSSInsecureSkipVerify ¶
func WithTLSSInsecureSkipVerify() Option
func WithTableConfigOption ¶
func WithTableConfigOption(option tableConfig.Option) Option
func WithTraceCoordination ¶
func WithTraceCoordination(trace trace.Coordination) Option
WithTraceCoordination returns coordination trace option
func WithTraceDiscovery ¶
WithTraceDiscovery returns discovery trace option
func WithTraceDriver ¶
WithTraceDriver returns deadline which has associated Driver with it.
func WithTraceRatelimiter ¶
func WithTraceRatelimiter(trace trace.Ratelimiter) Option
WithTraceRatelimiter returns ratelimiter trace option
func WithTraceScheme ¶
WithTraceScheme returns scheme trace option
func WithTraceScripting ¶
WithTraceScripting scripting trace option
func WithTraceTable ¶
WithTraceTable returns table trace option
func WithUserAgent ¶
Source Files ¶
connection.go errors.go logger_options.go meta.go options.go version.go with.go
Directories ¶
- Version
- v3.16.12
- Published
- Mar 31, 2022
- Platform
- js/wasm
- Imports
- 42 packages
- Last checked
- now –
Tools for package owners.