Documentation ¶
Index ¶
- func ClearContext(x interface{}) interface{}
- func DriverOnClusterGet(t Driver, c context.Context) func(endpoint endpointInfo, _ error)
- func DriverOnClusterInsert(t Driver, c context.Context, endpoint endpointInfo) func(state ConnState)
- func DriverOnClusterRemove(t Driver, c context.Context, endpoint endpointInfo) func(state ConnState)
- func DriverOnClusterUpdate(t Driver, c context.Context, endpoint endpointInfo) func(state ConnState)
- func DriverOnConnInvoke(t Driver, c context.Context, endpoint endpointInfo, m Method) func(_ error, issues []Issue, opID string, state ConnState)
- func DriverOnConnNewStream(t Driver, c context.Context, endpoint endpointInfo, m Method) func(error) func(state ConnState, _ error)
- func DriverOnConnRelease(t Driver, c context.Context, endpoint endpointInfo) func(lock int)
- func DriverOnConnStateChange(t Driver, c context.Context, endpoint endpointInfo, state ConnState) func(state ConnState)
- func DriverOnConnTake(t Driver, c context.Context, endpoint endpointInfo) func(lock int, _ error)
- func DriverOnDiscovery(t Driver, c context.Context) func(endpoints []string, _ error)
- func DriverOnGetCredentials(t Driver, c context.Context) func(tokenOk bool, _ error)
- func DriverOnNetClose(t Driver, address string) func(error)
- func DriverOnNetDial(t Driver, address string) func(error)
- func DriverOnNetRead(t Driver, address string, buffer int) func(received int, _ error)
- func DriverOnNetWrite(t Driver, address string, bytes int) func(sent int, _ error)
- func DriverOnPessimizeNode(t Driver, c context.Context, endpoint endpointInfo, state ConnState, ...) func(state ConnState, _ error)
- func RetryOnRetry(t Retry, c context.Context) func(_ context.Context, latency time.Duration, err error)
- func Stub(x interface{}, f func(name string, args ...interface{}))
- func TableOnPoolClose(t Table, c context.Context) func(error)
- func TableOnPoolGet(t Table, c context.Context) func(session sessionInfo, attempts int, _ error)
- func TableOnPoolInit(t Table, c context.Context) func(limit int, keepAliveMinSize int)
- func TableOnPoolPut(t Table, c context.Context, session sessionInfo) func(error)
- func TableOnPoolRetry(t Table, c context.Context, idempotent bool) func(error) func(attempts int, _ error)
- func TableOnPoolSessionClose(t Table, c context.Context, session sessionInfo) func()
- func TableOnPoolSessionNew(t Table, c context.Context) func(session sessionInfo, _ error)
- func TableOnPoolTake(t Table, c context.Context, session sessionInfo) func() func(took bool, _ error)
- func TableOnPoolWait(t Table, c context.Context) func(session sessionInfo, _ error)
- func TableOnSessionDelete(t Table, c context.Context, session sessionInfo) func(error)
- func TableOnSessionKeepAlive(t Table, c context.Context, session sessionInfo) func(error)
- func TableOnSessionNew(t Table, c context.Context) func(session sessionInfo, _ error)
- func TableOnSessionQueryExecute(t Table, c context.Context, session sessionInfo, query dataQuery, ...) func(tx transactionInfo, prepared bool, result result, _ error)
- func TableOnSessionQueryPrepare(t Table, c context.Context, session sessionInfo, query string) func(result dataQuery, _ error)
- func TableOnSessionQueryStreamExecute(t Table, c context.Context, session sessionInfo, query dataQuery, ...) func(result streamResult, _ error)
- func TableOnSessionQueryStreamRead(t Table, c context.Context, session sessionInfo) func(result streamResult, _ error)
- func TableOnSessionTransactionBegin(t Table, c context.Context, session sessionInfo) func(tx transactionInfo, _ error)
- func TableOnSessionTransactionCommit(t Table, c context.Context, session sessionInfo, tx transactionInfo) func(error)
- func TableOnSessionTransactionRollback(t Table, c context.Context, session sessionInfo, tx transactionInfo) func(error)
- func WithDriver(ctx context.Context, t Driver) context.Context
- func WithRetry(ctx context.Context, t Retry) context.Context
- func WithTable(ctx context.Context, t Table) context.Context
- type ClusterGetDoneInfo
- type ClusterGetStartInfo
- type ClusterInsertDoneInfo
- type ClusterInsertStartInfo
- type ClusterRemoveDoneInfo
- type ClusterRemoveStartInfo
- type ClusterUpdateDoneInfo
- type ClusterUpdateStartInfo
- type ConnInvokeDoneInfo
- type ConnInvokeStartInfo
- type ConnNewStreamDoneInfo
- type ConnNewStreamRecvInfo
- type ConnNewStreamStartInfo
- type ConnReleaseDoneInfo
- type ConnReleaseStartInfo
- type ConnState
- type ConnStateChangeDoneInfo
- type ConnStateChangeStartInfo
- type ConnTakeDoneInfo
- type ConnTakeStartInfo
- type Details
- type DiscoveryDoneInfo
- type DiscoveryStartInfo
- type Driver
- type ExecuteDataQueryStartInfo
- type FieldStubber
- type GetCredentialsDoneInfo
- type GetCredentialsStartInfo
- type Issue
- type KeepAliveDoneInfo
- type KeepAliveStartInfo
- type Method
- type NetCloseDoneInfo
- type NetCloseStartInfo
- type NetDialDoneInfo
- type NetDialStartInfo
- type NetReadDoneInfo
- type NetReadStartInfo
- type NetWriteDoneInfo
- type NetWriteStartInfo
- type PessimizeNodeDoneInfo
- type PessimizeNodeStartInfo
- type PoolCloseDoneInfo
- type PoolCloseStartInfo
- type PoolGetDoneInfo
- type PoolGetStartInfo
- type PoolInitDoneInfo
- type PoolInitStartInfo
- type PoolPutDoneInfo
- type PoolPutStartInfo
- type PoolRetryDoneInfo
- type PoolRetryInternalInfo
- type PoolRetryStartInfo
- type PoolSessionCloseDoneInfo
- type PoolSessionCloseStartInfo
- type PoolSessionNewDoneInfo
- type PoolSessionNewStartInfo
- type PoolTakeDoneInfo
- type PoolTakeStartInfo
- type PoolTakeWaitInfo
- type PoolWaitDoneInfo
- type PoolWaitStartInfo
- type PrepareDataQueryDoneInfo
- type Retry
- type RetryLoopDoneInfo
- type RetryLoopStartInfo
- type SessionDeleteDoneInfo
- type SessionDeleteStartInfo
- type SessionNewDoneInfo
- type SessionNewStartInfo
- type SessionQueryPrepareDoneInfo
- type SessionQueryPrepareStartInfo
- type SessionQueryStreamExecuteDoneInfo
- type SessionQueryStreamExecuteStartInfo
- type SessionQueryStreamReadDoneInfo
- type SessionQueryStreamReadStartInfo
- type SessionTransactionBeginDoneInfo
- type SessionTransactionBeginStartInfo
- type SessionTransactionCommitDoneInfo
- type SessionTransactionCommitStartInfo
- type SessionTransactionRollbackDoneInfo
- type SessionTransactionRollbackStartInfo
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearContext ¶
func ClearContext(x interface{}) interface{}
func DriverOnClusterGet ¶
func DriverOnClusterInsert ¶
func DriverOnClusterRemove ¶
func DriverOnClusterUpdate ¶
func DriverOnConnInvoke ¶
func DriverOnConnNewStream ¶
func DriverOnConnRelease ¶
func DriverOnConnStateChange ¶
func DriverOnConnTake ¶
func DriverOnDiscovery ¶
func DriverOnGetCredentials ¶
func DriverOnNetClose ¶
func DriverOnNetDial ¶
func DriverOnNetRead ¶
func DriverOnNetWrite ¶
func DriverOnPessimizeNode ¶
func RetryOnRetry ¶
func Stub ¶
func Stub(x interface{}, f func(name string, args ...interface{}))
Stub is a helper function that stubs all functional fields of x with given f.
func TableOnPoolGet ¶
func TableOnPoolInit ¶
func TableOnPoolPut ¶
func TableOnPoolRetry ¶
func TableOnPoolSessionClose ¶
func TableOnPoolSessionNew ¶
func TableOnPoolTake ¶
func TableOnPoolWait ¶
func TableOnSessionDelete ¶
func TableOnSessionKeepAlive ¶
func TableOnSessionNew ¶
func WithDriver ¶
WithDriver returns deadline which has associated Driver with it.
Types ¶
type ClusterGetDoneInfo ¶
type ClusterGetDoneInfo struct { Endpoint endpointInfo Error error }
type ClusterGetStartInfo ¶
type ClusterInsertDoneInfo ¶
type ClusterInsertDoneInfo struct {
State ConnState
}
type ClusterInsertStartInfo ¶
type ClusterRemoveDoneInfo ¶
type ClusterRemoveDoneInfo struct {
State ConnState
}
type ClusterRemoveStartInfo ¶
type ClusterUpdateDoneInfo ¶
type ClusterUpdateDoneInfo struct {
State ConnState
}
type ClusterUpdateStartInfo ¶
type ConnInvokeDoneInfo ¶
type ConnInvokeStartInfo ¶
type ConnNewStreamDoneInfo ¶
type ConnNewStreamRecvInfo ¶
type ConnNewStreamRecvInfo struct {
Error error
}
type ConnNewStreamStartInfo ¶
type ConnReleaseDoneInfo ¶
type ConnReleaseDoneInfo struct {
Lock int
}
type ConnReleaseStartInfo ¶
type ConnStateChangeDoneInfo ¶
type ConnStateChangeDoneInfo struct {
State ConnState
}
type ConnTakeDoneInfo ¶
type ConnTakeStartInfo ¶
type Details ¶ added in v3.2.1
type Details uint64
const ( DriverSystemEvents Details = 1 << iota // 1 DriverClusterEvents // 2 DriverNetEvents // 4 DriverCoreEvents // 8 DriverCredentialsEvents // 16 DriverDiscoveryEvents // 32 TableSessionLifeCycleEvents // 64 TableSessionQueryInvokeEvents // 128 TableSessionQueryStreamEvents // 256 TableSessionTransactionEvents // 512 TablePoolLifeCycleEvents // 1024 TablePoolRetryEvents // 2048 TablePoolSessionLifeCycleEvents // 4096 TablePoolAPIEvents // 8192 DriverConnEvents = DriverNetEvents | DriverCoreEvents // 12 TableSessionQueryEvents = TableSessionQueryInvokeEvents | TableSessionQueryStreamEvents // 384 TableSessionEvents = TableSessionLifeCycleEvents | TableSessionQueryEvents | TableSessionTransactionEvents // 960 TablePoolEvents = TablePoolLifeCycleEvents | TablePoolRetryEvents | TablePoolSessionLifeCycleEvents | TablePoolAPIEvents // 15360 DetailsAll = ^Details(0) // 18446744073709551615 )
type DiscoveryDoneInfo ¶
type DiscoveryStartInfo ¶
type Driver ¶
type Driver struct { // Network events OnNetRead func(NetReadStartInfo) func(NetReadDoneInfo) OnNetWrite func(NetWriteStartInfo) func(NetWriteDoneInfo) OnNetDial func(NetDialStartInfo) func(NetDialDoneInfo) OnNetClose func(NetCloseStartInfo) func(NetCloseDoneInfo) // Conn events OnConnStateChange func(ConnStateChangeStartInfo) func(ConnStateChangeDoneInfo) OnConnInvoke func(ConnInvokeStartInfo) func(ConnInvokeDoneInfo) OnConnNewStream func(ConnNewStreamStartInfo) func(ConnNewStreamRecvInfo) func(ConnNewStreamDoneInfo) OnConnTake func(ConnTakeStartInfo) func(ConnTakeDoneInfo) OnConnRelease func(ConnReleaseStartInfo) func(ConnReleaseDoneInfo) // Cluster events OnClusterGet func(ClusterGetStartInfo) func(ClusterGetDoneInfo) OnClusterInsert func(ClusterInsertStartInfo) func(ClusterInsertDoneInfo) OnClusterUpdate func(ClusterUpdateStartInfo) func(ClusterUpdateDoneInfo) OnClusterRemove func(ClusterRemoveStartInfo) func(ClusterRemoveDoneInfo) OnPessimizeNode func(PessimizeNodeStartInfo) func(PessimizeNodeDoneInfo) // Credentials events OnGetCredentials func(GetCredentialsStartInfo) func(GetCredentialsDoneInfo) // Discovery events OnDiscovery func(DiscoveryStartInfo) func(DiscoveryDoneInfo) }
func ContextDriver ¶
ContextDriver returns Driver associated with ctx. If there is no Driver associated with ctx then zero value of Driver is returned.
type FieldStubber ¶
type FieldStubber struct { // OnStub is an optional callback that is called when field getting // stubbed. OnStub func(name string) // OnCall is an optional callback that will be called for each stubbed // field getting called. OnCall func(name string, args ...interface{}) }
FieldStubber contains options of filling all struct functional fields.
func (FieldStubber) Stub ¶
func (f FieldStubber) Stub(x reflect.Value)
Stub fills in given x struct.
type GetCredentialsDoneInfo ¶
type GetCredentialsStartInfo ¶
type KeepAliveDoneInfo ¶
type KeepAliveDoneInfo struct {
Error error
}
type KeepAliveStartInfo ¶
type NetCloseDoneInfo ¶
type NetCloseDoneInfo struct {
Error error
}
type NetCloseStartInfo ¶
type NetCloseStartInfo struct {
Address string
}
type NetDialDoneInfo ¶
type NetDialDoneInfo struct {
Error error
}
type NetDialStartInfo ¶
type NetDialStartInfo struct {
Address string
}
type NetReadDoneInfo ¶
type NetReadStartInfo ¶
type NetWriteDoneInfo ¶
type NetWriteStartInfo ¶
type PessimizeNodeDoneInfo ¶
type PessimizeNodeStartInfo ¶
type PoolCloseDoneInfo ¶
type PoolCloseDoneInfo struct {
Error error
}
type PoolCloseStartInfo ¶
type PoolGetDoneInfo ¶
type PoolGetStartInfo ¶
type PoolInitDoneInfo ¶
type PoolInitStartInfo ¶
type PoolPutDoneInfo ¶
type PoolPutDoneInfo struct {
Error error
}
type PoolPutStartInfo ¶
type PoolRetryDoneInfo ¶
type PoolRetryInternalInfo ¶
type PoolRetryInternalInfo struct {
Error error
}
type PoolRetryStartInfo ¶
type PoolSessionCloseDoneInfo ¶
type PoolSessionCloseDoneInfo struct { }
type PoolSessionNewDoneInfo ¶
type PoolSessionNewDoneInfo struct { Session sessionInfo Error error }
type PoolSessionNewStartInfo ¶
type PoolTakeDoneInfo ¶
type PoolTakeStartInfo ¶
type PoolTakeWaitInfo ¶
type PoolTakeWaitInfo struct { }
type PoolWaitDoneInfo ¶
type PoolWaitDoneInfo struct { Session sessionInfo Error error }
PoolWaitDoneInfo means a wait iteration inside Get call is done Warning: Session and Error may be nil at the same time. This means that a wait iteration donned without any significant result
type PoolWaitStartInfo ¶
type PrepareDataQueryDoneInfo ¶
type PrepareDataQueryDoneInfo struct { Result dataQuery Error error }
type Retry ¶
type Retry struct {
OnRetry func(RetryLoopStartInfo) func(RetryLoopDoneInfo)
}
func ContextRetry ¶
ContextRetry returns Retry associated with ctx. If there is no Retry associated with ctx then zero value of Retry is returned.
type RetryLoopDoneInfo ¶
type RetryLoopStartInfo ¶
type SessionDeleteDoneInfo ¶
type SessionDeleteDoneInfo struct {
Error error
}
type SessionDeleteStartInfo ¶
type SessionNewDoneInfo ¶
type SessionNewDoneInfo struct { Session sessionInfo Error error }
type SessionNewStartInfo ¶
type SessionQueryStreamExecuteDoneInfo ¶
type SessionQueryStreamExecuteDoneInfo struct { Result streamResult Error error }
type SessionQueryStreamReadDoneInfo ¶
type SessionQueryStreamReadDoneInfo struct { Result streamResult Error error }
type SessionTransactionBeginDoneInfo ¶
type SessionTransactionBeginDoneInfo struct { Tx transactionInfo Error error }
type SessionTransactionCommitDoneInfo ¶
type SessionTransactionCommitDoneInfo struct {
Error error
}
type SessionTransactionRollbackDoneInfo ¶
type SessionTransactionRollbackDoneInfo struct {
Error error
}
type Table ¶
type Table struct { // Session events OnSessionNew func(SessionNewStartInfo) func(SessionNewDoneInfo) OnSessionDelete func(SessionDeleteStartInfo) func(SessionDeleteDoneInfo) OnSessionKeepAlive func(KeepAliveStartInfo) func(KeepAliveDoneInfo) // Query events OnSessionQueryPrepare func(SessionQueryPrepareStartInfo) func(PrepareDataQueryDoneInfo) OnSessionQueryExecute func(ExecuteDataQueryStartInfo) func(SessionQueryPrepareDoneInfo) // Stream events OnSessionQueryStreamExecute func(SessionQueryStreamExecuteStartInfo) func(SessionQueryStreamExecuteDoneInfo) OnSessionQueryStreamRead func(SessionQueryStreamReadStartInfo) func(SessionQueryStreamReadDoneInfo) // Transaction events OnSessionTransactionBegin func(SessionTransactionBeginStartInfo) func(SessionTransactionBeginDoneInfo) OnSessionTransactionCommit func(SessionTransactionCommitStartInfo) func(SessionTransactionCommitDoneInfo) OnSessionTransactionRollback func(SessionTransactionRollbackStartInfo) func(SessionTransactionRollbackDoneInfo) // Pool events OnPoolInit func(PoolInitStartInfo) func(PoolInitDoneInfo) OnPoolClose func(PoolCloseStartInfo) func(PoolCloseDoneInfo) OnPoolRetry func(PoolRetryStartInfo) func(info PoolRetryInternalInfo) func(PoolRetryDoneInfo) // Pool session lifecycle events OnPoolSessionNew func(PoolSessionNewStartInfo) func(PoolSessionNewDoneInfo) OnPoolSessionClose func(PoolSessionCloseStartInfo) func(PoolSessionCloseDoneInfo) // Pool common API events OnPoolPut func(PoolPutStartInfo) func(PoolPutDoneInfo) // Pool native API events OnPoolGet func(PoolGetStartInfo) func(PoolGetDoneInfo) OnPoolWait func(PoolWaitStartInfo) func(PoolWaitDoneInfo) // Pool ydbsql API events OnPoolTake func(PoolTakeStartInfo) func(PoolTakeWaitInfo) func(PoolTakeDoneInfo) }
Table contains options for tracing table client activity.
func ContextTable ¶
ContextTable returns Table associated with ctx. If there is no Table associated with ctx then zero value of Trace is returned.