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 (
	QUIET = Level(logger.QUIET)
	TRACE = Level(logger.TRACE)
	DEBUG = Level(logger.DEBUG)
	INFO  = Level(logger.INFO)
	WARN  = Level(logger.WARN)
	ERROR = Level(logger.ERROR)
	FATAL = Level(logger.FATAL)
)
const Version = meta.Version

Version alias for except cycle import

Functions

func IsOperationError

func IsOperationError(err error) bool

func IsOperationErrorAlreadyExistsError

func IsOperationErrorAlreadyExistsError(err error) bool

func IsOperationErrorCode

func IsOperationErrorCode(err error, codes ...int32) 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 IsTimeoutError

func IsTimeoutError(err error) bool

func IsTransportError

func IsTransportError(err error) bool

func IsTransportErrorCancelled

func IsTransportErrorCancelled(err error) bool

func IsTransportErrorCode

func IsTransportErrorCode(err error, codes ...int32) 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))

Types

type ConnectParams

type ConnectParams interface {
	Endpoint() string
	Database() string
	Secure() bool
	Token() string
	String() string
}

func ConnectionString

func ConnectionString(uri string) (ConnectParams, error)

func EndpointDatabase

func EndpointDatabase(endpoint string, database string, secure bool) ConnectParams

func MustConnectionString

func MustConnectionString(uri string) ConnectParams

type Connection

type Connection interface {
	DB

	// Table returns table client with options from Connection instance.
	// Options provide options replacement for requested table client
	// such as endpoint, database, secure connection flag and credentials
	// Options replacement feature not implements now
	Table(opts ...Option) table.Client

	// Scheme returns scheme client with options from Connection instance.
	// Options provide options replacement for requested scheme client
	// such as endpoint, database, secure connection flag and credentials
	// Options replacement feature not implements now
	Scheme(opts ...Option) scheme.Client

	// Coordination returns coordination client with options from Connection instance.
	// Options provide options replacement for requested coordination client
	// such as endpoint, database, secure connection flag and credentials
	// Options replacement feature not implements now
	Coordination(opts ...Option) coordination.Client

	// RateLimiter returns rate limiter client with options from Connection instance.
	// Options provide options replacement for requested rate limiter client
	// such as endpoint, database, secure connection flag and credentials
	// Options replacement feature not implements now
	RateLimiter(opts ...Option) ratelimiter.Client

	// Discovery returns discovery client with options from Connection instance.
	// Options provide options replacement for requested discovery client
	// such as endpoint, database, secure connection flag and credentials
	// Options replacement feature not implements now
	Discovery(opts ...Option) discovery.Client
}

func New

func New(ctx context.Context, opts ...Option) (_ Connection, err error)

New connects to name and return name runtime holder

type DB

type DB interface {
	cluster.Cluster

	// Endpoint returns initial endpoint
	Endpoint() string

	// Name returns database name
	Name() string

	// Secure returns true if database connection is secure
	Secure() bool
}

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 Level

type Level logger.Level

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 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, db *db) error

func MergeOptions

func MergeOptions(options ...Option) Option

func With

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

func WithAccessTokenCredentials

func WithAccessTokenCredentials(accessToken string) Option

func WithAnonymousCredentials

func WithAnonymousCredentials() Option

func WithBalancingConfig

func WithBalancingConfig(balancerConfig config.BalancerConfig) Option

func WithCertificate

func WithCertificate(cert *x509.Certificate) Option

func WithCertificatesFromFile

func WithCertificatesFromFile(caFile string) Option

func WithCertificatesFromPem

func WithCertificatesFromPem(bytes []byte) Option

func WithConnectParams

func WithConnectParams(params ConnectParams) Option

func WithConnectionString

func WithConnectionString(connection string) Option

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 WithLogger

func WithLogger(details trace.Details, opts ...LoggerOption) 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

func WithSessionPoolKeepAliveMinSize

func WithSessionPoolKeepAliveMinSize(keepAliveMinSize int) Option

func WithSessionPoolKeepAliveTimeout

func WithSessionPoolKeepAliveTimeout(keepAliveTimeout time.Duration) Option

func WithSessionPoolSizeLimit

func WithSessionPoolSizeLimit(sizeLimit int) Option

func WithTableConfigOption

func WithTableConfigOption(option config.Option) Option

func WithTraceDriver

func WithTraceDriver(trace trace.Driver) Option

WithTraceDriver returns deadline which has associated Driver with it.

func WithTraceTable

func WithTraceTable(trace trace.Table) Option

WithTraceTable returns deadline which has associated Driver with it.

Source Files

connect_params.go connection.go coordiantion.go discovery.go errors.go options.go ratelimiter.go scheme.go table.go version.go

Directories

PathSynopsis
cluster
config
coordination
credentials
internal
log
ratelimiter
retry
scheme
sugar
table
table/config
table/options
table/result
table/stats
table/types
test
testutil
testutil/timeutil
testutil/timeutil/timetest
trace
Version
v3.5.4
Published
Jan 3, 2022
Platform
js/wasm
Imports
32 packages
Last checked
now

Tools for package owners.