v3 – github.com/ydb-platform/ydb-go-sdk/v3 Index | Files | Directories

package ydb

import "github.com/ydb-platform/ydb-go-sdk/v3"

Index

Constants

const Version = meta.Version

Version alias for except cycle import

Functions

func IsOperationError

func IsOperationError(err error, codes ...int32) bool

func IsOperationErrorAlreadyExistsError

func IsOperationErrorAlreadyExistsError(err error) bool

func IsOperationErrorNotFoundError

func IsOperationErrorNotFoundError(err error) bool

func IsOperationErrorOverloaded

func IsOperationErrorOverloaded(err error) bool

func IsOperationErrorSchemeError

func IsOperationErrorSchemeError(err error) bool

func IsOperationErrorUnavailable

func IsOperationErrorUnavailable(err error) bool

func IsRatelimiterAcquireError

func IsRatelimiterAcquireError(err error) bool

func IsTimeoutError

func IsTimeoutError(err error) bool

func IsTransportError

func IsTransportError(err error, codes ...int32) bool

func IsTransportErrorCancelled

func IsTransportErrorCancelled(err error) bool

func IsTransportErrorResourceExhausted

func IsTransportErrorResourceExhausted(err error) bool

func IsYdbError

func IsYdbError(err error) bool

func IterateByIssues

func IterateByIssues(err error, it func(message string, code uint32, severity uint32))

func RegisterParser

func RegisterParser(param string, parser func(value string) ([]config.Option, error)) (err error)

func ToRatelimiterAcquireError

func ToRatelimiterAcquireError(err error) ratelimiter.AcquireError

func WithRequestType

func WithRequestType(ctx context.Context, requestType string) context.Context

WithRequestType returns a copy of parent context with custom request type

func WithTraceID

func WithTraceID(ctx context.Context, traceID string) context.Context

WithTraceID returns a copy of parent context with traceID

Types

type Connection

type Connection interface {
	closer.Closer
	db.ConnectionInfo
	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

type Error interface {
	error

	Code() int32
	Name() string
}

func OperationErrorDescription

func OperationErrorDescription(err error) Error

func TransportErrorDescription

func TransportErrorDescription(err error) Error

type LoggerOption

type LoggerOption logger.Option

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

type Option func(ctx context.Context, c *connection) error

func MergeOptions

func MergeOptions(opts ...Option) Option

func With

func With(options ...config.Option) Option

func WithAccessTokenCredentials

func WithAccessTokenCredentials(accessToken string) Option

func WithAnonymousCredentials

func WithAnonymousCredentials() Option

func WithBalancer

func WithBalancer(balancer balancer.Balancer) Option

func WithCertificate

func WithCertificate(cert *x509.Certificate) Option

func WithCertificatesFromFile

func WithCertificatesFromFile(caFile string) Option

func WithCertificatesFromPem

func WithCertificatesFromPem(bytes []byte) Option

func WithConnectionString

func WithConnectionString(connectionString string) Option

WithConnectionString accept connection string like 'grpc[s]://{endpoint}/?database={database}'

func WithConnectionTTL

func WithConnectionTTL(ttl time.Duration) Option

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

func WithDatabase

func WithDatabase(database string) Option

func WithDialTimeout

func WithDialTimeout(timeout time.Duration) Option

func WithDiscoveryInterval

func WithDiscoveryInterval(discoveryInterval time.Duration) Option

func WithEndpoint

func WithEndpoint(endpoint string) Option

func WithInsecure

func WithInsecure() Option

func WithLogger

func WithLogger(details trace.Details, opts ...LoggerOption) Option

func WithMinTLSVersion

func WithMinTLSVersion(minVersion uint16) Option

func WithRatelimiterOptions

func WithRatelimiterOptions(opts ...ratelimiterConfig.Option) Option

func WithRequestsType

func WithRequestsType(requestsType string) Option

func WithSecure

func WithSecure(secure bool) Option

func WithSessionPoolCreateSessionTimeout

func WithSessionPoolCreateSessionTimeout(createSessionTimeout time.Duration) Option

func WithSessionPoolDeleteTimeout

func WithSessionPoolDeleteTimeout(deleteTimeout time.Duration) Option

func WithSessionPoolIdleThreshold

func WithSessionPoolIdleThreshold(idleThreshold time.Duration) Option

WithSessionPoolIdleThreshold defines keep-alive interval for idle sessions Warning: if defined WithConnectionTTL - idleThreshold must be less than connectionTTL

func WithSessionPoolKeepAliveMinSize

func WithSessionPoolKeepAliveMinSize(keepAliveMinSize int) Option

func WithSessionPoolKeepAliveTimeout

func WithSessionPoolKeepAliveTimeout(keepAliveTimeout time.Duration) Option

func WithSessionPoolSizeLimit

func WithSessionPoolSizeLimit(sizeLimit int) Option

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

func WithTraceDiscovery(trace trace.Discovery) Option

WithTraceDiscovery returns discovery trace option

func WithTraceDriver

func WithTraceDriver(trace trace.Driver) Option

WithTraceDriver returns deadline which has associated Driver with it.

func WithTraceRatelimiter

func WithTraceRatelimiter(trace trace.Ratelimiter) Option

WithTraceRatelimiter returns ratelimiter trace option

func WithTraceScheme

func WithTraceScheme(trace trace.Scheme) Option

WithTraceScheme returns scheme trace option

func WithTraceScripting

func WithTraceScripting(trace trace.Scripting) Option

WithTraceScripting scripting trace option

func WithTraceTable

func WithTraceTable(trace trace.Table) Option

WithTraceTable returns table trace option

func WithUserAgent

func WithUserAgent(userAgent string) Option

Source Files

connection.go errors.go logger_options.go meta.go options.go version.go with.go

Directories

PathSynopsis
balancers
cmd
cmd/gtrace
cmd/gtrace/internal
config
coordination
coordination/config
credentials
discovery
discovery/config
internal
log
ratelimiter
ratelimiter/config
retry
scheme
scheme/config
scripting
scripting/config
sugar
table
table/config
table/options
table/result
table/result/indexed
table/result/named
table/stats
table/types
test
testutil
testutil/timeutil
testutil/timeutil/timetest
trace
Version
v3.14.5-rc5
Published
Mar 17, 2022
Platform
darwin/amd64
Imports
41 packages
Last checked
now

Tools for package owners.