trace

package
v3.11.8-rc4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearContext

func ClearContext(x interface{}) interface{}

func DiscoveryOnDiscover added in v3.10.0

func DiscoveryOnDiscover(t Discovery, c *context.Context, address string, database string) func(location string, endpoints []EndpointInfo, _ error)

func DiscoveryOnWhoAmI added in v3.10.0

func DiscoveryOnWhoAmI(t Discovery, c *context.Context) func(user string, groups []string, _ error)

func DriverOnClose added in v3.5.0

func DriverOnClose(t Driver, c *context.Context) func(error)

func DriverOnClusterClose added in v3.11.0

func DriverOnClusterClose(t Driver, c *context.Context) func(error)

func DriverOnClusterGet

func DriverOnClusterGet(t Driver, c *context.Context) func(endpoint EndpointInfo, _ error)

func DriverOnClusterInit added in v3.11.0

func DriverOnClusterInit(t Driver, c *context.Context) func()

func DriverOnClusterInsert

func DriverOnClusterInsert(t Driver, c *context.Context, endpoint EndpointInfo) func(state ConnState)

func DriverOnClusterRemove

func DriverOnClusterRemove(t Driver, c *context.Context, endpoint EndpointInfo) func(state ConnState)

func DriverOnClusterUpdate

func DriverOnClusterUpdate(t Driver, c *context.Context, endpoint EndpointInfo) func(state ConnState)

func DriverOnConnInvoke

func DriverOnConnInvoke(t Driver, c *context.Context, endpoint EndpointInfo, m Method) func(_ error, issues []Issue, opID string, state ConnState)

func DriverOnConnNewStream

func DriverOnConnNewStream(t Driver, c *context.Context, endpoint EndpointInfo, m Method) func(error) func(state ConnState, _ error)

func DriverOnConnRelease

func DriverOnConnRelease(t Driver, c *context.Context, endpoint EndpointInfo) func(lock int)

func DriverOnConnStateChange

func DriverOnConnStateChange(t Driver, c *context.Context, endpoint EndpointInfo, state ConnState) func(state ConnState)

func DriverOnConnTake

func DriverOnConnTake(t Driver, c *context.Context, endpoint EndpointInfo) func(lock int, _ error)

func DriverOnGetCredentials

func DriverOnGetCredentials(t Driver, c *context.Context) func(token string, _ error)

func DriverOnInit added in v3.5.0

func DriverOnInit(t Driver, c *context.Context, endpoint string, database string, secure bool) func(error)

func DriverOnNetClose

func DriverOnNetClose(t Driver, address string) func(error)

func DriverOnNetDial

func DriverOnNetDial(t Driver, c *context.Context, address string) func(error)

func DriverOnNetRead

func DriverOnNetRead(t Driver, address string, buffer int) func(received int, _ error)

func DriverOnNetWrite

func DriverOnNetWrite(t Driver, address string, bytes int) func(sent int, _ error)

func DriverOnPessimizeNode

func DriverOnPessimizeNode(t Driver, c *context.Context, endpoint EndpointInfo, state ConnState, cause error) func(state ConnState)

func DriverOnResolve added in v3.11.0

func DriverOnResolve(t Driver, target string, resolved []string) func(error)

func RetryOnRetry

func RetryOnRetry(t Retry, c context.Context, iD string, idempotent bool) func(error) func(attempts int, _ error)

func ScriptingOnExecute added in v3.10.0

func ScriptingOnExecute(t Scripting, c context.Context, query string, parameters queryParameters) func(result result, _ error)

func ScriptingOnExplain added in v3.10.0

func ScriptingOnExplain(t Scripting, c *context.Context, session sessionInfo, query string) func(aST string, plan string, _ error)

func ScriptingOnStreamExecute added in v3.10.0

func ScriptingOnStreamExecute(t Scripting, c context.Context, query string, parameters queryParameters) func(error) func(error)

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 TableOnPoolClose

func TableOnPoolClose(t Table, c *context.Context) func(error)

func TableOnPoolDo added in v3.8.0

func TableOnPoolDo(t Table, c *context.Context, idempotent bool) func(error) func(attempts int, _ error)

func TableOnPoolDoTx added in v3.8.0

func TableOnPoolDoTx(t Table, c *context.Context, idempotent bool) func(error) func(attempts int, _ error)

func TableOnPoolGet

func TableOnPoolGet(t Table, c *context.Context) func(session sessionInfo, attempts int, _ error)

func TableOnPoolInit

func TableOnPoolInit(t Table, c *context.Context) func(limit int, keepAliveMinSize int)

func TableOnPoolPut

func TableOnPoolPut(t Table, c *context.Context, session sessionInfo) func(error)

func TableOnPoolSessionClose

func TableOnPoolSessionClose(t Table, c *context.Context, session sessionInfo) func()

func TableOnPoolSessionNew

func TableOnPoolSessionNew(t Table, c *context.Context) func(session sessionInfo, _ error)

func TableOnPoolStateChange added in v3.11.0

func TableOnPoolStateChange(t Table, size int, event string)

func TableOnPoolWait

func TableOnPoolWait(t Table, c *context.Context) func(session sessionInfo, _ error)

func TableOnSessionDelete

func TableOnSessionDelete(t Table, c *context.Context, session sessionInfo) func(error)

func TableOnSessionKeepAlive

func TableOnSessionKeepAlive(t Table, c *context.Context, session sessionInfo) func(error)

func TableOnSessionNew

func TableOnSessionNew(t Table, c *context.Context) func(session sessionInfo, _ error)

func TableOnSessionQueryExecute

func TableOnSessionQueryExecute(t Table, c *context.Context, session sessionInfo, query dataQuery, parameters queryParameters) func(tx transactionInfo, prepared bool, result result, _ error)

func TableOnSessionQueryExplain added in v3.10.0

func TableOnSessionQueryExplain(t Table, c *context.Context, session sessionInfo, query string) func(aST string, plan string, _ error)

func TableOnSessionQueryPrepare

func TableOnSessionQueryPrepare(t Table, c *context.Context, session sessionInfo, query string) func(result dataQuery, _ error)

func TableOnSessionQueryStreamExecute

func TableOnSessionQueryStreamExecute(t Table, c *context.Context, session sessionInfo, query dataQuery, parameters queryParameters) func(error) func(error)

func TableOnSessionQueryStreamRead

func TableOnSessionQueryStreamRead(t Table, c *context.Context, session sessionInfo) func(error) func(error)

func TableOnSessionTransactionBegin

func TableOnSessionTransactionBegin(t Table, c *context.Context, session sessionInfo) func(tx transactionInfo, _ error)

func TableOnSessionTransactionCommit

func TableOnSessionTransactionCommit(t Table, c *context.Context, session sessionInfo, tx transactionInfo) func(error)

func TableOnSessionTransactionRollback

func TableOnSessionTransactionRollback(t Table, c *context.Context, session sessionInfo, tx transactionInfo) func(error)

func WithDefaultDetails added in v3.11.0

func WithDefaultDetails(defaultDetails Details) matchDetailsOption

func WithDriver

func WithDriver(ctx context.Context, t Driver) context.Context

WithDriver returns deadline which has associated Driver with it.

func WithPOSIXMatch added in v3.11.0

func WithPOSIXMatch() matchDetailsOption

func WithRetry

func WithRetry(ctx context.Context, t Retry) context.Context

WithRetry returns deadline which has associated Retry with it.

func WithTable

func WithTable(ctx context.Context, t Table) context.Context

WithTable returns deadline which has associated Trace with it.

Types

type CloseDoneInfo added in v3.5.0

type CloseDoneInfo struct {
	Error error
}

type CloseStartInfo added in v3.5.0

type CloseStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type ClusterCloseDoneInfo added in v3.11.0

type ClusterCloseDoneInfo struct {
	Error error
}

type ClusterCloseStartInfo added in v3.11.0

type ClusterCloseStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type ClusterGetDoneInfo

type ClusterGetDoneInfo struct {
	Endpoint EndpointInfo
	Error    error
}

type ClusterGetStartInfo

type ClusterGetStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type ClusterInitDoneInfo added in v3.11.0

type ClusterInitDoneInfo struct{}

type ClusterInitStartInfo added in v3.11.0

type ClusterInitStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type ClusterInsertDoneInfo

type ClusterInsertDoneInfo struct {
	State ConnState
}

type ClusterInsertStartInfo

type ClusterInsertStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
}

type ClusterRemoveDoneInfo

type ClusterRemoveDoneInfo struct {
	State ConnState
}

type ClusterRemoveStartInfo

type ClusterRemoveStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
}

type ClusterUpdateDoneInfo

type ClusterUpdateDoneInfo struct {
	State ConnState
}

type ClusterUpdateStartInfo

type ClusterUpdateStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
}

type ConnInvokeDoneInfo

type ConnInvokeDoneInfo struct {
	Error  error
	Issues []Issue
	OpID   string
	State  ConnState
}

type ConnInvokeStartInfo

type ConnInvokeStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
	Method   Method
}

type ConnNewStreamDoneInfo

type ConnNewStreamDoneInfo struct {
	State ConnState
	Error error
}

type ConnNewStreamRecvInfo

type ConnNewStreamRecvInfo struct {
	Error error
}

type ConnNewStreamStartInfo

type ConnNewStreamStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
	Method   Method
}

type ConnReleaseDoneInfo

type ConnReleaseDoneInfo struct {
	Lock int
}

type ConnReleaseStartInfo

type ConnReleaseStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
}

type ConnState

type ConnState interface {
	fmt.Stringer

	IsValid() bool
	Code() int
}

type ConnStateChangeDoneInfo

type ConnStateChangeDoneInfo struct {
	State ConnState
}

type ConnStateChangeStartInfo

type ConnStateChangeStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
	State    ConnState
}

type ConnTakeDoneInfo

type ConnTakeDoneInfo struct {
	Lock  int
	Error error
}

type ConnTakeStartInfo

type ConnTakeStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
}

type Coordination added in v3.10.0

type Coordination struct{}

func (Coordination) Compose added in v3.10.0

func (t Coordination) Compose(x Coordination) (ret Coordination)

Compose returns a new Coordination which has functional fields composed both from t and x.

type Details added in v3.2.1

type Details uint64
const (
	DriverNetEvents         Details = 1 << iota // 1
	DriverResolverEvents                        // 2
	DriverClusterEvents                         // 4
	DriverCoreEvents                            // 8
	DriverCredentialsEvents                     // 16

	DiscoveryEvents // 32

	TableSessionLifeCycleEvents     // 64
	TableSessionQueryInvokeEvents   // 128
	TableSessionQueryStreamEvents   // 256
	TableSessionTransactionEvents   // 512
	TablePoolLifeCycleEvents        // 1024
	TablePoolRetryEvents            // 2048
	TablePoolSessionLifeCycleEvents // 4096
	TablePoolAPIEvents              // 8192

	RetryEvents // 16384

	SchemeEvents // 32768

	ScriptingEvents // 65536

	RatelimiterEvents // 131072

	CoordinationEvents // 262144

	DriverEvents = DriverClusterEvents |
		DriverNetEvents |
		DriverResolverEvents |
		DriverCoreEvents |
		DriverCredentialsEvents // 63

	TableEvents = TableSessionLifeCycleEvents |
		TableSessionQueryInvokeEvents |
		TableSessionQueryStreamEvents |
		TableSessionTransactionEvents |
		TablePoolLifeCycleEvents |
		TablePoolRetryEvents |
		TablePoolSessionLifeCycleEvents |
		TablePoolAPIEvents // 16320

	TablePoolEvents = TablePoolLifeCycleEvents |
		TablePoolRetryEvents |
		TablePoolSessionLifeCycleEvents |
		TablePoolAPIEvents // 16320

	DriverConnEvents = DriverNetEvents |
		DriverResolverEvents |
		DriverCoreEvents // 28

	TableSessionQueryEvents = TableSessionQueryInvokeEvents |
		TableSessionQueryStreamEvents // 384
	TableSessionEvents = TableSessionLifeCycleEvents |
		TableSessionQueryEvents |
		TableSessionTransactionEvents // 960

	DetailsAll = ^Details(0) // 18446744073709551615
)

func MatchDetails added in v3.11.0

func MatchDetails(pattern string, opts ...matchDetailsOption) (d Details)

type DiscoverDoneInfo added in v3.10.0

type DiscoverDoneInfo struct {
	Location  string
	Endpoints []EndpointInfo
	Error     error
}

type DiscoverStartInfo added in v3.10.0

type DiscoverStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Address  string
	Database string
}

type Discovery added in v3.10.0

type Discovery struct {
	OnDiscover func(DiscoverStartInfo) func(DiscoverDoneInfo)
	OnWhoAmI   func(WhoAmIStartInfo) func(WhoAmIDoneInfo)
}

func (Discovery) Compose added in v3.10.0

func (t Discovery) Compose(x Discovery) (ret Discovery)

Compose returns a new Discovery which has functional fields composed both from t and x.

type Driver

type Driver struct {
	// Driver runtime events
	OnInit  func(InitStartInfo) func(InitDoneInfo)
	OnClose func(CloseStartInfo) func(CloseDoneInfo)

	// Network events
	OnNetRead  func(NetReadStartInfo) func(NetReadDoneInfo)
	OnNetWrite func(NetWriteStartInfo) func(NetWriteDoneInfo)
	OnNetDial  func(NetDialStartInfo) func(NetDialDoneInfo)
	OnNetClose func(NetCloseStartInfo) func(NetCloseDoneInfo)

	// Resolver events
	OnResolve func(ResolveStartInfo) func(ResolveDoneInfo)

	// 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
	OnClusterInit   func(ClusterInitStartInfo) func(ClusterInitDoneInfo)
	OnClusterClose  func(ClusterCloseStartInfo) func(ClusterCloseDoneInfo)
	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)
}

func ContextDriver

func ContextDriver(ctx context.Context) Driver

ContextDriver returns Driver associated with ctx. If there is no Driver associated with ctx then zero value of Driver is returned.

func (Driver) Compose

func (t Driver) Compose(x Driver) (ret Driver)

Compose returns a new Driver which has functional fields composed both from t and x.

type EndpointInfo added in v3.11.8

type EndpointInfo interface {
	fmt.Stringer

	NodeID() uint32
	Address() string
	LocalDC() bool
	Location() string
	LastUpdated() time.Time
}

type ExecuteDataQueryDoneInfo added in v3.10.0

type ExecuteDataQueryDoneInfo struct {
	Tx       transactionInfo
	Prepared bool
	Result   result
	Error    error
}

type ExecuteDataQueryStartInfo

type ExecuteDataQueryStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context    *context.Context
	Session    sessionInfo
	Query      dataQuery
	Parameters queryParameters
}

type ExecuteDoneInfo added in v3.10.0

type ExecuteDoneInfo struct {
	Result result
	Error  error
}

type ExecuteStartInfo added in v3.10.0

type ExecuteStartInfo struct {
	Context    context.Context
	Query      string
	Parameters queryParameters
}

type ExplainQueryDoneInfo added in v3.10.0

type ExplainQueryDoneInfo struct {
	AST   string
	Plan  string
	Error error
}

type ExplainQueryStartInfo added in v3.10.0

type ExplainQueryStartInfo struct {
	Context *context.Context
	Session sessionInfo
	Query   string
}

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 GetCredentialsDoneInfo struct {
	Token string
	Error error
}

type GetCredentialsStartInfo

type GetCredentialsStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type InitDoneInfo added in v3.5.0

type InitDoneInfo struct {
	Error error
}

type InitStartInfo added in v3.5.0

type InitStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint string
	Database string
	Secure   bool
}

type Issue

type Issue interface {
	GetMessage() string
	GetIssueCode() uint32
	GetSeverity() uint32
}

Issue interface

type KeepAliveDoneInfo

type KeepAliveDoneInfo struct {
	Error error
}

type KeepAliveStartInfo

type KeepAliveStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
}

type Method

type Method string

Method represents rpc method.

func (Method) Name

func (m Method) Name() (s string)

Name returns the rpc method name.

func (Method) Service

func (m Method) Service() (s string)

Service returns the rpc service name.

func (Method) Split

func (m Method) Split() (service, method string)

Split returns service name and method.

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 {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Address string
}

type NetReadDoneInfo

type NetReadDoneInfo struct {
	Received int
	Error    error
}

type NetReadStartInfo

type NetReadStartInfo struct {
	Address string
	Buffer  int
}

type NetWriteDoneInfo

type NetWriteDoneInfo struct {
	Sent  int
	Error error
}

type NetWriteStartInfo

type NetWriteStartInfo struct {
	Address string
	Bytes   int
}

type PessimizeNodeDoneInfo

type PessimizeNodeDoneInfo struct {
	State ConnState
}

type PessimizeNodeStartInfo

type PessimizeNodeStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context  *context.Context
	Endpoint EndpointInfo
	State    ConnState
	Cause    error
}

type PooStateChangeInfo added in v3.11.0

type PooStateChangeInfo struct {
	Size  int
	Event string
}

type PoolCloseDoneInfo

type PoolCloseDoneInfo struct {
	Error error
}

type PoolCloseStartInfo

type PoolCloseStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type PoolDoDoneInfo added in v3.8.0

type PoolDoDoneInfo struct {
	Attempts int
	Error    error
}

type PoolDoIntermediateInfo added in v3.10.0

type PoolDoIntermediateInfo struct {
	Error error
}

type PoolDoStartInfo added in v3.8.0

type PoolDoStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context    *context.Context
	Idempotent bool
}

type PoolDoTxDoneInfo added in v3.8.0

type PoolDoTxDoneInfo struct {
	Attempts int
	Error    error
}

type PoolDoTxIntermediateInfo added in v3.10.0

type PoolDoTxIntermediateInfo struct {
	Error error
}

type PoolDoTxStartInfo added in v3.8.0

type PoolDoTxStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context    *context.Context
	Idempotent bool
}

type PoolGetDoneInfo

type PoolGetDoneInfo struct {
	Session  sessionInfo
	Attempts int
	Error    error
}

type PoolGetStartInfo

type PoolGetStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type PoolInitDoneInfo

type PoolInitDoneInfo struct {
	Limit            int
	KeepAliveMinSize int
}

type PoolInitStartInfo

type PoolInitStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type PoolPutDoneInfo

type PoolPutDoneInfo struct {
	Error error
}

type PoolPutStartInfo

type PoolPutStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
}

type PoolSessionCloseDoneInfo

type PoolSessionCloseDoneInfo struct{}

type PoolSessionCloseStartInfo

type PoolSessionCloseStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
}

type PoolSessionNewDoneInfo

type PoolSessionNewDoneInfo struct {
	Session sessionInfo
	Error   error
}

type PoolSessionNewStartInfo

type PoolSessionNewStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

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 resultErr

type PoolWaitStartInfo

type PoolWaitStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type PrepareDataQueryDoneInfo

type PrepareDataQueryDoneInfo struct {
	Result dataQuery
	Error  error
}

type PrepareDataQueryStartInfo added in v3.10.0

type PrepareDataQueryStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
	Query   string
}

type Ratelimiter added in v3.10.0

type Ratelimiter struct{}

func (Ratelimiter) Compose added in v3.10.0

func (t Ratelimiter) Compose(x Ratelimiter) (ret Ratelimiter)

Compose returns a new Ratelimiter which has functional fields composed both from t and x.

type ResolveDoneInfo added in v3.11.0

type ResolveDoneInfo struct {
	Error error
}

type ResolveStartInfo added in v3.11.0

type ResolveStartInfo struct {
	Target   string
	Resolved []string
}

type Retry

type Retry struct {
	OnRetry func(RetryLoopStartInfo) func(RetryLoopIntermediateInfo) func(RetryLoopDoneInfo)
}

func ContextRetry

func ContextRetry(ctx context.Context) Retry

ContextRetry returns Retry associated with ctx. If there is no Retry associated with ctx then zero value of Retry is returned.

func (Retry) Compose

func (t Retry) Compose(x Retry) (ret Retry)

Compose returns a new Retry which has functional fields composed both from t and x.

type RetryLoopDoneInfo

type RetryLoopDoneInfo struct {
	Attempts int
	Error    error
}

type RetryLoopIntermediateInfo added in v3.10.0

type RetryLoopIntermediateInfo struct {
	Error error
}

type RetryLoopStartInfo

type RetryLoopStartInfo struct {
	Context    context.Context
	ID         string
	Idempotent bool
}

type Scheme added in v3.10.0

type Scheme struct{}

func (Scheme) Compose added in v3.10.0

func (t Scheme) Compose(x Scheme) (ret Scheme)

Compose returns a new Scheme which has functional fields composed both from t and x.

type Scripting added in v3.10.0

type Scripting struct {
	OnExecute       func(ExecuteStartInfo) func(ExecuteDoneInfo)
	OnStreamExecute func(StreamExecuteStartInfo) func(StreamExecuteIntermediateInfo) func(StreamExecuteDoneInfo)
	OnExplain       func(info ExplainQueryStartInfo) func(doneInfo ExplainQueryDoneInfo)
}

func (Scripting) Compose added in v3.10.0

func (t Scripting) Compose(x Scripting) (ret Scripting)

Compose returns a new Scripting which has functional fields composed both from t and x.

type SessionDeleteDoneInfo

type SessionDeleteDoneInfo struct {
	Error error
}

type SessionDeleteStartInfo

type SessionDeleteStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
}

type SessionNewDoneInfo

type SessionNewDoneInfo struct {
	Session sessionInfo
	Error   error
}

type SessionNewStartInfo

type SessionNewStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

type SessionQueryStreamExecuteDoneInfo

type SessionQueryStreamExecuteDoneInfo struct {
	Error error
}

type SessionQueryStreamExecuteIntermediateInfo added in v3.10.0

type SessionQueryStreamExecuteIntermediateInfo struct {
	Error error
}

type SessionQueryStreamExecuteStartInfo

type SessionQueryStreamExecuteStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context    *context.Context
	Session    sessionInfo
	Query      dataQuery
	Parameters queryParameters
}

type SessionQueryStreamReadDoneInfo

type SessionQueryStreamReadDoneInfo struct {
	Error error
}

type SessionQueryStreamReadIntermediateInfo added in v3.10.0

type SessionQueryStreamReadIntermediateInfo struct {
	Error error
}

type SessionQueryStreamReadStartInfo

type SessionQueryStreamReadStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
}

type SessionTransactionBeginDoneInfo

type SessionTransactionBeginDoneInfo struct {
	Tx    transactionInfo
	Error error
}

type SessionTransactionBeginStartInfo

type SessionTransactionBeginStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
}

type SessionTransactionCommitDoneInfo

type SessionTransactionCommitDoneInfo struct {
	Error error
}

type SessionTransactionCommitStartInfo

type SessionTransactionCommitStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
	Tx      transactionInfo
}

type SessionTransactionRollbackDoneInfo

type SessionTransactionRollbackDoneInfo struct {
	Error error
}

type SessionTransactionRollbackStartInfo

type SessionTransactionRollbackStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
	Session sessionInfo
	Tx      transactionInfo
}

type StreamExecuteDoneInfo added in v3.10.0

type StreamExecuteDoneInfo struct {
	Error error
}

type StreamExecuteIntermediateInfo added in v3.10.0

type StreamExecuteIntermediateInfo struct {
	Error error
}

type StreamExecuteStartInfo added in v3.10.0

type StreamExecuteStartInfo struct {
	Context    context.Context
	Query      string
	Parameters queryParameters
}

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(PrepareDataQueryStartInfo) func(PrepareDataQueryDoneInfo)
	OnSessionQueryExecute func(ExecuteDataQueryStartInfo) func(ExecuteDataQueryDoneInfo)
	OnSessionQueryExplain func(ExplainQueryStartInfo) func(ExplainQueryDoneInfo)
	// Stream events
	OnSessionQueryStreamExecute func(
		SessionQueryStreamExecuteStartInfo,
	) func(
		SessionQueryStreamExecuteIntermediateInfo,
	) func(
		SessionQueryStreamExecuteDoneInfo,
	)
	OnSessionQueryStreamRead func(
		SessionQueryStreamReadStartInfo,
	) func(
		SessionQueryStreamReadIntermediateInfo,
	) 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)
	// Pool state event
	OnPoolStateChange func(PooStateChangeInfo)
	// Pool retry events
	OnPoolDo   func(PoolDoStartInfo) func(info PoolDoIntermediateInfo) func(PoolDoDoneInfo)
	OnPoolDoTx func(PoolDoTxStartInfo) func(info PoolDoTxIntermediateInfo) func(PoolDoTxDoneInfo)
	// Pool session lifecycle events
	OnPoolSessionNew   func(PoolSessionNewStartInfo) func(PoolSessionNewDoneInfo)
	OnPoolSessionClose func(PoolSessionCloseStartInfo) func(PoolSessionCloseDoneInfo)
	// Pool common API events
	OnPoolPut  func(PoolPutStartInfo) func(PoolPutDoneInfo)
	OnPoolGet  func(PoolGetStartInfo) func(PoolGetDoneInfo)
	OnPoolWait func(PoolWaitStartInfo) func(PoolWaitDoneInfo)
}

Table contains options for tracing table client activity.

func ContextTable

func ContextTable(ctx context.Context) Table

ContextTable returns Table associated with ctx. If there is no Table associated with ctx then zero value of Trace is returned.

func (Table) Compose

func (t Table) Compose(x Table) (ret Table)

Compose returns a new Table which has functional fields composed both from t and x.

type WhoAmIDoneInfo added in v3.10.0

type WhoAmIDoneInfo struct {
	User   string
	Groups []string
	Error  error
}

type WhoAmIStartInfo added in v3.10.0

type WhoAmIStartInfo struct {
	// Context make available context in trace callback function.
	// Pointer to context provide replacement of context in trace callback function.
	// Warning: concurrent access to pointer on client side must be excluded.
	// Safe replacement of context are provided only inside callback function
	Context *context.Context
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL