instrumented

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapConnector

func WrapConnector(conn driver.Connector, itpr Interceptor) driver.Connector

WrapConnector :

Types

type Interceptor

type Interceptor interface {
	// Connection interceptors
	ConnPing(context.Context, driver.Pinger) error
	ConnBeginTx(context.Context, driver.ConnBeginTx, driver.TxOptions) (driver.Tx, error)
	ConnPrepareContext(context.Context, driver.ConnPrepareContext, string) (driver.Stmt, error)
	ConnExecContext(context.Context, driver.ExecerContext, string, []driver.NamedValue) (driver.Result, error)
	ConnQueryContext(context.Context, driver.QueryerContext, string, []driver.NamedValue) (driver.Rows, error)

	// Results interceptors
	ResultLastInsertId(context.Context, driver.Result) (int64, error)
	ResultRowsAffected(context.Context, driver.Result) (int64, error)

	// Rows interceptors
	RowsNext(context.Context, driver.Rows, []driver.Value) error

	// Stmt interceptors
	StmtExecContext(context.Context, driver.StmtExecContext, string, []driver.NamedValue) (driver.Result, error)
	StmtQueryContext(context.Context, driver.StmtQueryContext, string, []driver.NamedValue) (driver.Rows, error)
	StmtClose(context.Context, driver.Stmt) error

	// Tx interceptors
	TxCommit(context.Context, driver.Tx) error
	TxRollback(context.Context, driver.Tx) error
}

Interceptor :

type NullInterceptor

type NullInterceptor struct{}

NullInterceptor is a complete passthrough interceptor that implements every method of the Interceptor interface and performs no additional logic. Users should Embed it in their own interceptor so that they only need to define the specific functions they are interested in intercepting.

func (NullInterceptor) ConnBeginTx

func (NullInterceptor) ConnBeginTx(ctx context.Context, conn driver.ConnBeginTx, txOpts driver.TxOptions) (driver.Tx, error)

ConnBeginTx :

func (NullInterceptor) ConnExecContext

func (NullInterceptor) ConnExecContext(ctx context.Context, conn driver.ExecerContext, query string, args []driver.NamedValue) (driver.Result, error)

ConnExecContext :

func (NullInterceptor) ConnPing

func (NullInterceptor) ConnPing(ctx context.Context, conn driver.Pinger) error

ConnPing :

func (NullInterceptor) ConnPrepareContext

func (NullInterceptor) ConnPrepareContext(ctx context.Context, conn driver.ConnPrepareContext, query string) (driver.Stmt, error)

ConnPrepareContext :

func (NullInterceptor) ConnQueryContext

func (NullInterceptor) ConnQueryContext(ctx context.Context, conn driver.QueryerContext, query string, args []driver.NamedValue) (driver.Rows, error)

ConnQueryContext :

func (NullInterceptor) ResultLastInsertId

func (NullInterceptor) ResultLastInsertId(ctx context.Context, res driver.Result) (int64, error)

ResultLastInsertId :

func (NullInterceptor) ResultRowsAffected

func (NullInterceptor) ResultRowsAffected(ctx context.Context, res driver.Result) (int64, error)

ResultRowsAffected :

func (NullInterceptor) RowsNext

func (NullInterceptor) RowsNext(ctx context.Context, rows driver.Rows, dest []driver.Value) error

RowsNext :

func (NullInterceptor) StmtClose

func (NullInterceptor) StmtClose(ctx context.Context, stmt driver.Stmt) error

StmtClose :

func (NullInterceptor) StmtExecContext

func (NullInterceptor) StmtExecContext(ctx context.Context, stmt driver.StmtExecContext, _ string, args []driver.NamedValue) (driver.Result, error)

StmtExecContext :

func (NullInterceptor) StmtQueryContext

func (NullInterceptor) StmtQueryContext(ctx context.Context, stmt driver.StmtQueryContext, _ string, args []driver.NamedValue) (driver.Rows, error)

StmtQueryContext :

func (NullInterceptor) TxCommit

func (NullInterceptor) TxCommit(ctx context.Context, tx driver.Tx) error

TxCommit :

func (NullInterceptor) TxRollback

func (NullInterceptor) TxRollback(ctx context.Context, tx driver.Tx) error

TxRollback :

type Result

type Result interface {
	driver.Result
}

Result :

type Rows

type Rows interface {
	driver.RowsNextResultSet
	ColumnTypeScanType(index int) reflect.Type
}

Rows :

type Stmt

Stmt :

Jump to

Keyboard shortcuts

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