package trace

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

Index

Functions

func ClearContext

func ClearContext(x interface{}) interface{}

func DiscoveryOnDiscover

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

func DiscoveryOnWhoAmI

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

func DriverOnBalancerChooseEndpoint

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

func DriverOnBalancerClose

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

func DriverOnBalancerInit

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

func DriverOnBalancerUpdate

func DriverOnBalancerUpdate(t Driver, c *context.Context, needLocalDC bool) func(endpoints []EndpointInfo, localDC string, _ error)

func DriverOnClose

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

func DriverOnConnAllow

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

func DriverOnConnBan

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

func DriverOnConnClose

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

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 DriverOnConnPark

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

func DriverOnConnStateChange

func DriverOnConnStateChange(t Driver, endpoint EndpointInfo, state ConnState) func(state ConnState)

func DriverOnConnTake

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

func DriverOnGetCredentials

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

func DriverOnInit

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 DriverOnRepeaterWakeUp

func DriverOnRepeaterWakeUp(t Driver, c *context.Context, name string, event string) func(error)

func DriverOnResolve

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 ScriptingOnClose

func ScriptingOnClose(t Scripting, c *context.Context) func(error)

func ScriptingOnExecute

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

func ScriptingOnExplain

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

func ScriptingOnStreamExecute

func ScriptingOnStreamExecute(t Scripting, c *context.Context, query string, parameters scriptingQueryParameters) 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 TableOnClose

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

func TableOnCreateSession

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

func TableOnDo

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

func TableOnDoTx

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

func TableOnInit

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

func TableOnPoolGet

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

func TableOnPoolPut

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

func TableOnPoolSessionClose

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

func TableOnPoolSessionNew

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

func TableOnPoolStateChange

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

func TableOnPoolWait

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

func TableOnSessionDelete

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

func TableOnSessionKeepAlive

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

func TableOnSessionNew

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

func TableOnSessionQueryExecute

func TableOnSessionQueryExecute(t Table, c *context.Context, session tableSessionInfo, query tableDataQuery, parameters tableQueryParameters) func(tx tableTransactionInfo, prepared bool, result tableResult, _ error)

func TableOnSessionQueryExplain

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

func TableOnSessionQueryPrepare

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

func TableOnSessionQueryStreamExecute

func TableOnSessionQueryStreamExecute(t Table, c *context.Context, session tableSessionInfo, query tableDataQuery, parameters tableQueryParameters) func(error) func(error)

func TableOnSessionQueryStreamRead

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

func TableOnSessionTransactionBegin

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

func TableOnSessionTransactionCommit

func TableOnSessionTransactionCommit(t Table, c *context.Context, session tableSessionInfo, tx tableTransactionInfo) func(error)

func TableOnSessionTransactionRollback

func TableOnSessionTransactionRollback(t Table, c *context.Context, session tableSessionInfo, tx tableTransactionInfo) func(error)

func WithDefaultDetails

func WithDefaultDetails(defaultDetails Details) matchDetailsOption

func WithPOSIXMatch

func WithPOSIXMatch() matchDetailsOption

Types

type ConnState

type ConnState interface {
	fmt.Stringer

	IsValid() bool
	Code() int
}

type Coordination

type Coordination struct{}

Coordination specified trace of coordination client activity. gtrace:gen

func (Coordination) Compose

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

type CoordinationComposeOption

type CoordinationComposeOption func(o *coordinationComposeOptions)

CoordinationOption specified Coordination compose option

func WithCoordinationPanicCallback

func WithCoordinationPanicCallback(cb func(e interface{})) CoordinationComposeOption

WithCoordinationPanicCallback specified behavior on panic

type Details

type Details uint64
const (
	DriverNetEvents         Details = 1 << iota // 1
	DriverConnEvents                            // 2
	DriverBalancerEvents                        // 4
	DriverResolverEvents                        // 8
	DriverRepeaterEvents                        // 16
	DriverCredentialsEvents                     // 32

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

	RetryEvents // 8192

	DiscoveryEvents // 16384

	SchemeEvents // 32768

	ScriptingEvents // 65536

	RatelimiterEvents // 131072

	CoordinationEvents // 262144

	// Deprecated: has no effect now
	DriverClusterEvents

	DriverEvents = DriverNetEvents |
		DriverConnEvents |
		DriverBalancerEvents |
		DriverResolverEvents |
		DriverRepeaterEvents |
		DriverCredentialsEvents // 63

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

	TablePoolEvents = TablePoolLifeCycleEvents |
		TablePoolSessionLifeCycleEvents |
		TablePoolAPIEvents // 15360

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

	DetailsAll = ^Details(0) // 18446744073709551615
)

func MatchDetails

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

type Discovery

type Discovery struct {
	OnDiscover func(DiscoveryDiscoverStartInfo) func(DiscoveryDiscoverDoneInfo)
	OnWhoAmI   func(DiscoveryWhoAmIStartInfo) func(DiscoveryWhoAmIDoneInfo)
}

Discovery specified trace of discovery client activity. gtrace:gen

func (Discovery) Compose

func (t Discovery) Compose(x Discovery, opts ...DiscoveryComposeOption) (ret Discovery)

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

type DiscoveryComposeOption

type DiscoveryComposeOption func(o *discoveryComposeOptions)

DiscoveryOption specified Discovery compose option

func WithDiscoveryPanicCallback

func WithDiscoveryPanicCallback(cb func(e interface{})) DiscoveryComposeOption

WithDiscoveryPanicCallback specified behavior on panic

type DiscoveryDiscoverDoneInfo

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

type DiscoveryDiscoverStartInfo

type DiscoveryDiscoverStartInfo 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 DiscoveryWhoAmIDoneInfo

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

type DiscoveryWhoAmIStartInfo

type DiscoveryWhoAmIStartInfo 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 Driver

type Driver struct {
	// Driver runtime events
	OnInit  func(DriverInitStartInfo) func(DriverInitDoneInfo)
	OnClose func(DriverCloseStartInfo) func(DriverCloseDoneInfo)

	// Network events
	OnNetRead  func(DriverNetReadStartInfo) func(DriverNetReadDoneInfo)
	OnNetWrite func(DriverNetWriteStartInfo) func(DriverNetWriteDoneInfo)
	OnNetDial  func(DriverNetDialStartInfo) func(DriverNetDialDoneInfo)
	OnNetClose func(DriverNetCloseStartInfo) func(DriverNetCloseDoneInfo)

	// Resolver events
	OnResolve func(DriverResolveStartInfo) func(DriverResolveDoneInfo)

	// Conn events
	OnConnStateChange func(DriverConnStateChangeStartInfo) func(DriverConnStateChangeDoneInfo)
	OnConnInvoke      func(DriverConnInvokeStartInfo) func(DriverConnInvokeDoneInfo)
	OnConnNewStream   func(
		DriverConnNewStreamStartInfo,
	) func(
		DriverConnNewStreamRecvInfo,
	) func(
		DriverConnNewStreamDoneInfo,
	)
	OnConnTake  func(DriverConnTakeStartInfo) func(DriverConnTakeDoneInfo)
	OnConnPark  func(DriverConnParkStartInfo) func(DriverConnParkDoneInfo)
	OnConnBan   func(DriverConnBanStartInfo) func(DriverConnBanDoneInfo)
	OnConnAllow func(DriverConnAllowStartInfo) func(DriverConnAllowDoneInfo)
	OnConnClose func(DriverConnCloseStartInfo) func(DriverConnCloseDoneInfo)

	// Repeater events
	OnRepeaterWakeUp func(DriverRepeaterWakeUpStartInfo) func(DriverRepeaterWakeUpDoneInfo)

	// Balancer events
	OnBalancerInit           func(DriverBalancerInitStartInfo) func(DriverBalancerInitDoneInfo)
	OnBalancerClose          func(DriverBalancerCloseStartInfo) func(DriverBalancerCloseDoneInfo)
	OnBalancerChooseEndpoint func(DriverBalancerChooseEndpointStartInfo) func(DriverBalancerChooseEndpointDoneInfo)
	OnBalancerUpdate         func(DriverBalancerUpdateStartInfo) func(DriverBalancerUpdateDoneInfo)

	// Credentials events
	OnGetCredentials func(DriverGetCredentialsStartInfo) func(DriverGetCredentialsDoneInfo)
}

Driver specified trace of common driver activity. gtrace:gen

func (Driver) Compose

func (t Driver) Compose(x Driver, opts ...DriverComposeOption) (ret Driver)

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

type DriverBalancerChooseEndpointDoneInfo

type DriverBalancerChooseEndpointDoneInfo struct {
	Endpoint EndpointInfo
	Error    error
}

type DriverBalancerChooseEndpointStartInfo

type DriverBalancerChooseEndpointStartInfo 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 DriverBalancerCloseDoneInfo

type DriverBalancerCloseDoneInfo struct {
	Error error
}

type DriverBalancerCloseStartInfo

type DriverBalancerCloseStartInfo 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 DriverBalancerInitDoneInfo

type DriverBalancerInitDoneInfo struct {
	Error error
}

type DriverBalancerInitStartInfo

type DriverBalancerInitStartInfo 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 DriverBalancerUpdateDoneInfo

type DriverBalancerUpdateDoneInfo struct {
	Endpoints []EndpointInfo
	LocalDC   string
	Error     error
}

type DriverBalancerUpdateStartInfo

type DriverBalancerUpdateStartInfo 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
	NeedLocalDC bool
}

type DriverCloseDoneInfo

type DriverCloseDoneInfo struct {
	Error error
}

type DriverCloseStartInfo

type DriverCloseStartInfo 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 DriverComposeOption

type DriverComposeOption func(o *driverComposeOptions)

DriverOption specified Driver compose option

func WithDriverPanicCallback

func WithDriverPanicCallback(cb func(e interface{})) DriverComposeOption

WithDriverPanicCallback specified behavior on panic

type DriverConnAllowDoneInfo

type DriverConnAllowDoneInfo struct {
	State ConnState
}

type DriverConnAllowStartInfo

type DriverConnAllowStartInfo 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 DriverConnBanDoneInfo

type DriverConnBanDoneInfo struct {
	State ConnState
}

type DriverConnBanStartInfo

type DriverConnBanStartInfo 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 DriverConnCloseDoneInfo

type DriverConnCloseDoneInfo struct {
	Error error
}

type DriverConnCloseStartInfo

type DriverConnCloseStartInfo 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 DriverConnInvokeDoneInfo

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

type DriverConnInvokeStartInfo

type DriverConnInvokeStartInfo 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 DriverConnNewStreamDoneInfo

type DriverConnNewStreamDoneInfo struct {
	State ConnState
	Error error
}

type DriverConnNewStreamRecvInfo

type DriverConnNewStreamRecvInfo struct {
	Error error
}

type DriverConnNewStreamStartInfo

type DriverConnNewStreamStartInfo 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 DriverConnParkDoneInfo

type DriverConnParkDoneInfo struct {
	Error error
}

type DriverConnParkStartInfo

type DriverConnParkStartInfo 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 DriverConnStateChangeDoneInfo

type DriverConnStateChangeDoneInfo struct {
	State ConnState
}

type DriverConnStateChangeStartInfo

type DriverConnStateChangeStartInfo struct {
	Endpoint EndpointInfo
	State    ConnState
}

type DriverConnTakeDoneInfo

type DriverConnTakeDoneInfo struct {
	Error error
}

type DriverConnTakeStartInfo

type DriverConnTakeStartInfo 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 DriverGetCredentialsDoneInfo

type DriverGetCredentialsDoneInfo struct {
	Token string
	Error error
}

type DriverGetCredentialsStartInfo

type DriverGetCredentialsStartInfo 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 DriverInitDoneInfo

type DriverInitDoneInfo struct {
	Error error
}

type DriverInitStartInfo

type DriverInitStartInfo 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 DriverNetCloseDoneInfo

type DriverNetCloseDoneInfo struct {
	Error error
}

type DriverNetCloseStartInfo

type DriverNetCloseStartInfo struct {
	Address string
}

type DriverNetDialDoneInfo

type DriverNetDialDoneInfo struct {
	Error error
}

type DriverNetDialStartInfo

type DriverNetDialStartInfo 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 DriverNetReadDoneInfo

type DriverNetReadDoneInfo struct {
	Received int
	Error    error
}

type DriverNetReadStartInfo

type DriverNetReadStartInfo struct {
	Address string
	Buffer  int
}

type DriverNetWriteDoneInfo

type DriverNetWriteDoneInfo struct {
	Sent  int
	Error error
}

type DriverNetWriteStartInfo

type DriverNetWriteStartInfo struct {
	Address string
	Bytes   int
}

type DriverRepeaterWakeUpDoneInfo

type DriverRepeaterWakeUpDoneInfo struct {
	Error error
}

type DriverRepeaterWakeUpStartInfo

type DriverRepeaterWakeUpStartInfo 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
	Name    string
	Event   string
}

type DriverResolveDoneInfo

type DriverResolveDoneInfo struct {
	Error error
}

type DriverResolveStartInfo

type DriverResolveStartInfo struct {
	Target   string
	Resolved []string
}

type EndpointInfo

type EndpointInfo interface {
	fmt.Stringer

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

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 Issue

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

Issue declare interface of operation error issues

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 Ratelimiter

type Ratelimiter struct{}

Ratelimiter specified trace of ratelimiter client activity. gtrace:gen

func (Ratelimiter) Compose

func (t Ratelimiter) Compose(x Ratelimiter, opts ...RatelimiterComposeOption) (ret Ratelimiter)

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

type RatelimiterComposeOption

type RatelimiterComposeOption func(o *ratelimiterComposeOptions)

RatelimiterOption specified Ratelimiter compose option

func WithRatelimiterPanicCallback

func WithRatelimiterPanicCallback(cb func(e interface{})) RatelimiterComposeOption

WithRatelimiterPanicCallback specified behavior on panic

type Retry

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

Retry specified trace of retry call activity. gtrace:gen

func (Retry) Compose

func (t Retry) Compose(x Retry, opts ...RetryComposeOption) (ret Retry)

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

type RetryComposeOption

type RetryComposeOption func(o *retryComposeOptions)

RetryOption specified Retry compose option

func WithRetryPanicCallback

func WithRetryPanicCallback(cb func(e interface{})) RetryComposeOption

WithRetryPanicCallback specified behavior on panic

type RetryLoopDoneInfo

type RetryLoopDoneInfo struct {
	Attempts int
	Error    error
}

type RetryLoopIntermediateInfo

type RetryLoopIntermediateInfo struct {
	Error error
}

type RetryLoopStartInfo

type RetryLoopStartInfo 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
	ID         string
	Idempotent bool
}

type Scheme

type Scheme struct{}

Scheme specified trace of scheme client activity. gtrace:gen

func (Scheme) Compose

func (t Scheme) Compose(x Scheme, opts ...SchemeComposeOption) (ret Scheme)

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

type SchemeComposeOption

type SchemeComposeOption func(o *schemeComposeOptions)

SchemeOption specified Scheme compose option

func WithSchemePanicCallback

func WithSchemePanicCallback(cb func(e interface{})) SchemeComposeOption

WithSchemePanicCallback specified behavior on panic

type Scripting

Scripting specified trace of scripting client activity. gtrace:gen

func (Scripting) Compose

func (t Scripting) Compose(x Scripting, opts ...ScriptingComposeOption) (ret Scripting)

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

type ScriptingCloseDoneInfo

type ScriptingCloseDoneInfo struct {
	Error error
}

type ScriptingCloseStartInfo

type ScriptingCloseStartInfo 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 ScriptingComposeOption

type ScriptingComposeOption func(o *scriptingComposeOptions)

ScriptingOption specified Scripting compose option

func WithScriptingPanicCallback

func WithScriptingPanicCallback(cb func(e interface{})) ScriptingComposeOption

WithScriptingPanicCallback specified behavior on panic

type ScriptingExecuteDoneInfo

type ScriptingExecuteDoneInfo struct {
	Result scriptingResult
	Error  error
}

type ScriptingExecuteStartInfo

type ScriptingExecuteStartInfo 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
	Query      string
	Parameters scriptingQueryParameters
}

type ScriptingExplainDoneInfo

type ScriptingExplainDoneInfo struct {
	Plan  string
	Error error
}

type ScriptingExplainStartInfo

type ScriptingExplainStartInfo 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
	Query   string
}

type ScriptingStreamExecuteDoneInfo

type ScriptingStreamExecuteDoneInfo struct {
	Error error
}

type ScriptingStreamExecuteIntermediateInfo

type ScriptingStreamExecuteIntermediateInfo struct {
	Error error
}

type ScriptingStreamExecuteStartInfo

type ScriptingStreamExecuteStartInfo 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
	Query      string
	Parameters scriptingQueryParameters
}

type Table

type Table struct {
	// Client events
	OnInit          func(TableInitStartInfo) func(TableInitDoneInfo)
	OnClose         func(TableCloseStartInfo) func(TableCloseDoneInfo)
	OnDo            func(TableDoStartInfo) func(info TableDoIntermediateInfo) func(TableDoDoneInfo)
	OnDoTx          func(TableDoTxStartInfo) func(info TableDoTxIntermediateInfo) func(TableDoTxDoneInfo)
	OnCreateSession func(
		TableCreateSessionStartInfo,
	) func(
		info TableCreateSessionIntermediateInfo,
	) func(
		TableCreateSessionDoneInfo,
	)
	// Session events
	OnSessionNew       func(TableSessionNewStartInfo) func(TableSessionNewDoneInfo)
	OnSessionDelete    func(TableSessionDeleteStartInfo) func(TableSessionDeleteDoneInfo)
	OnSessionKeepAlive func(TableKeepAliveStartInfo) func(TableKeepAliveDoneInfo)
	// Query events
	OnSessionQueryPrepare func(TablePrepareDataQueryStartInfo) func(TablePrepareDataQueryDoneInfo)
	OnSessionQueryExecute func(TableExecuteDataQueryStartInfo) func(TableExecuteDataQueryDoneInfo)
	OnSessionQueryExplain func(TableExplainQueryStartInfo) func(TableExplainQueryDoneInfo)
	// Stream events
	OnSessionQueryStreamExecute func(
		TableSessionQueryStreamExecuteStartInfo,
	) func(
		TableSessionQueryStreamExecuteIntermediateInfo,
	) func(
		TableSessionQueryStreamExecuteDoneInfo,
	)
	OnSessionQueryStreamRead func(
		TableSessionQueryStreamReadStartInfo,
	) func(
		TableSessionQueryStreamReadIntermediateInfo,
	) func(
		TableSessionQueryStreamReadDoneInfo,
	)
	// Transaction events
	OnSessionTransactionBegin  func(TableSessionTransactionBeginStartInfo) func(TableSessionTransactionBeginDoneInfo)
	OnSessionTransactionCommit func(
		TableSessionTransactionCommitStartInfo,
	) func(
		TableSessionTransactionCommitDoneInfo,
	)
	OnSessionTransactionRollback func(
		TableSessionTransactionRollbackStartInfo,
	) func(
		TableSessionTransactionRollbackDoneInfo,
	)
	// Pool state event
	OnPoolStateChange func(TablePoolStateChangeInfo)
	// Pool session lifecycle events
	OnPoolSessionNew   func(TablePoolSessionNewStartInfo) func(TablePoolSessionNewDoneInfo)
	OnPoolSessionClose func(TablePoolSessionCloseStartInfo) func(TablePoolSessionCloseDoneInfo)
	// Pool common API events
	OnPoolPut  func(TablePoolPutStartInfo) func(TablePoolPutDoneInfo)
	OnPoolGet  func(TablePoolGetStartInfo) func(TablePoolGetDoneInfo)
	OnPoolWait func(TablePoolWaitStartInfo) func(TablePoolWaitDoneInfo)
}

Table specified trace of table client activity. gtrace:gen

func (Table) Compose

func (t Table) Compose(x Table, opts ...TableComposeOption) (ret Table)

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

type TableCloseDoneInfo

type TableCloseDoneInfo struct {
	Error error
}

type TableCloseStartInfo

type TableCloseStartInfo 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 TableComposeOption

type TableComposeOption func(o *tableComposeOptions)

TableOption specified Table compose option

func WithTablePanicCallback

func WithTablePanicCallback(cb func(e interface{})) TableComposeOption

WithTablePanicCallback specified behavior on panic

type TableCreateSessionDoneInfo

type TableCreateSessionDoneInfo struct {
	Session  tableSessionInfo
	Attempts int
	Error    error
}

type TableCreateSessionIntermediateInfo

type TableCreateSessionIntermediateInfo struct {
	Error error
}

type TableCreateSessionStartInfo

type TableCreateSessionStartInfo 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 TableDoDoneInfo

type TableDoDoneInfo struct {
	Attempts int
	Error    error
}

type TableDoIntermediateInfo

type TableDoIntermediateInfo struct {
	Error error
}

type TableDoStartInfo

type TableDoStartInfo 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 TableDoTxDoneInfo

type TableDoTxDoneInfo struct {
	Attempts int
	Error    error
}

type TableDoTxIntermediateInfo

type TableDoTxIntermediateInfo struct {
	Error error
}

type TableDoTxStartInfo

type TableDoTxStartInfo 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 TableExecuteDataQueryDoneInfo

type TableExecuteDataQueryDoneInfo struct {
	Tx       tableTransactionInfo
	Prepared bool
	Result   tableResult
	Error    error
}

type TableExecuteDataQueryStartInfo

type TableExecuteDataQueryStartInfo 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     tableSessionInfo
	Query       tableDataQuery
	Parameters  tableQueryParameters
	KeepInCache bool
}

type TableExplainQueryDoneInfo

type TableExplainQueryDoneInfo struct {
	AST   string
	Plan  string
	Error error
}

type TableExplainQueryStartInfo

type TableExplainQueryStartInfo 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 tableSessionInfo
	Query   string
}

type TableInitDoneInfo

type TableInitDoneInfo struct {
	Limit            int
	KeepAliveMinSize int
}

type TableInitStartInfo

type TableInitStartInfo 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 TableKeepAliveDoneInfo

type TableKeepAliveDoneInfo struct {
	Error error
}

type TableKeepAliveStartInfo

type TableKeepAliveStartInfo 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 tableSessionInfo
}

type TablePoolGetDoneInfo

type TablePoolGetDoneInfo struct {
	Session  tableSessionInfo
	Attempts int
	Error    error
}

type TablePoolGetStartInfo

type TablePoolGetStartInfo 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 TablePoolPutDoneInfo

type TablePoolPutDoneInfo struct {
	Error error
}

type TablePoolPutStartInfo

type TablePoolPutStartInfo 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 tableSessionInfo
}

type TablePoolSessionCloseDoneInfo

type TablePoolSessionCloseDoneInfo struct{}

type TablePoolSessionCloseStartInfo

type TablePoolSessionCloseStartInfo 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 tableSessionInfo
}

type TablePoolSessionNewDoneInfo

type TablePoolSessionNewDoneInfo struct {
	Session tableSessionInfo
	Error   error
}

type TablePoolSessionNewStartInfo

type TablePoolSessionNewStartInfo 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 TablePoolStateChangeInfo

type TablePoolStateChangeInfo struct {
	Size  int
	Event string
}

type TablePoolWaitDoneInfo

type TablePoolWaitDoneInfo struct {
	Session tableSessionInfo
	Error   error
}

TablePoolWaitDoneInfo 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 tableResultErr

type TablePoolWaitStartInfo

type TablePoolWaitStartInfo 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 TablePrepareDataQueryDoneInfo

type TablePrepareDataQueryDoneInfo struct {
	Result tableDataQuery
	Error  error
}

type TablePrepareDataQueryStartInfo

type TablePrepareDataQueryStartInfo 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 tableSessionInfo
	Query   string
}

type TableSessionDeleteDoneInfo

type TableSessionDeleteDoneInfo struct {
	Error error
}

type TableSessionDeleteStartInfo

type TableSessionDeleteStartInfo 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 tableSessionInfo
}

type TableSessionNewDoneInfo

type TableSessionNewDoneInfo struct {
	Session tableSessionInfo
	Error   error
}

type TableSessionNewStartInfo

type TableSessionNewStartInfo 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 TableSessionQueryStreamExecuteDoneInfo

type TableSessionQueryStreamExecuteDoneInfo struct {
	Error error
}

type TableSessionQueryStreamExecuteIntermediateInfo

type TableSessionQueryStreamExecuteIntermediateInfo struct {
	Error error
}

type TableSessionQueryStreamExecuteStartInfo

type TableSessionQueryStreamExecuteStartInfo 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    tableSessionInfo
	Query      tableDataQuery
	Parameters tableQueryParameters
}

type TableSessionQueryStreamReadDoneInfo

type TableSessionQueryStreamReadDoneInfo struct {
	Error error
}

type TableSessionQueryStreamReadIntermediateInfo

type TableSessionQueryStreamReadIntermediateInfo struct {
	Error error
}

type TableSessionQueryStreamReadStartInfo

type TableSessionQueryStreamReadStartInfo 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 tableSessionInfo
}

type TableSessionTransactionBeginDoneInfo

type TableSessionTransactionBeginDoneInfo struct {
	Tx    tableTransactionInfo
	Error error
}

type TableSessionTransactionBeginStartInfo

type TableSessionTransactionBeginStartInfo 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 tableSessionInfo
}

type TableSessionTransactionCommitDoneInfo

type TableSessionTransactionCommitDoneInfo struct {
	Error error
}

type TableSessionTransactionCommitStartInfo

type TableSessionTransactionCommitStartInfo 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 tableSessionInfo
	Tx      tableTransactionInfo
}

type TableSessionTransactionRollbackDoneInfo

type TableSessionTransactionRollbackDoneInfo struct {
	Error error
}

type TableSessionTransactionRollbackStartInfo

type TableSessionTransactionRollbackStartInfo 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 tableSessionInfo
	Tx      tableTransactionInfo
}

Source Files

coordination.go coordination_gtrace.go details.go discovery.go discovery_gtrace.go driver.go driver_gtrace.go ratelimiter.go ratelimiter_gtrace.go retry.go retry_gtrace.go scheme.go scheme_gtrace.go scripting.go scripting_gtrace.go table.go table_gtrace.go traceutil.go

Version
v3.29.3
Published
Jul 22, 2022
Platform
darwin/amd64
Imports
6 packages
Last checked
4 seconds ago

Tools for package owners.