xraysql

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnInfo

type ConnInfo struct {
	SanitizedConnString       string
	DbType, DriverName        string
	DbVersion, DbUser, DbName string
}

General connection metainformation for tracing purposes

type ConnectionProvider

type ConnectionProvider interface {
	Connect(ctx context.Context) (driver.Conn, *ConnInfo, error)
}

Connection provider that also returns driver-specific connection metadata

type FakeDriver

type FakeDriver struct {
}

Driver implements a database/sql/driver.Driver, needed to satisfy the driver.Connector interface for sql.DB

func (*FakeDriver) Open

func (w *FakeDriver) Open(dsn string) (driver.Conn, error)

type InstrumentedConn

type InstrumentedConn struct {
	// contains filtered or unexported fields
}

func (*InstrumentedConn) Begin

func (ic *InstrumentedConn) Begin() (driver.Tx, error)

func (*InstrumentedConn) BeginTx

func (ic *InstrumentedConn) BeginTx(ctx context.Context,
	opts driver.TxOptions) (driver.Tx, error)

driver.ConnBeginTx

func (*InstrumentedConn) Close

func (ic *InstrumentedConn) Close() error

func (*InstrumentedConn) ExecContext

func (ic *InstrumentedConn) ExecContext(ctx context.Context,
	query string, args []driver.NamedValue) (driver.Result, error)

driver.ExecerContext

func (*InstrumentedConn) Ping

func (ic *InstrumentedConn) Ping(ctx context.Context) error

driver.Pinger

func (*InstrumentedConn) Prepare

func (ic *InstrumentedConn) Prepare(query string) (driver.Stmt, error)

driver.Conn

func (*InstrumentedConn) PrepareContext

func (ic *InstrumentedConn) PrepareContext(ctx context.Context,
	query string) (driver.Stmt, error)

driver.ConnPrepareContext

func (*InstrumentedConn) QueryContext

func (ic *InstrumentedConn) QueryContext(ctx context.Context,
	query string, args []driver.NamedValue) (driver.Rows, error)

driver.QueryerContext

type InstrumentedStmt

type InstrumentedStmt struct {
	// contains filtered or unexported fields
}

func (*InstrumentedStmt) Close

func (is *InstrumentedStmt) Close() error

func (*InstrumentedStmt) Exec

func (is *InstrumentedStmt) Exec(args []driver.Value) (driver.Result, error)

func (*InstrumentedStmt) ExecContext

func (is *InstrumentedStmt) ExecContext(ctx context.Context,
	args []driver.NamedValue) (driver.Result, error)

func (*InstrumentedStmt) NumInput

func (is *InstrumentedStmt) NumInput() int

func (*InstrumentedStmt) Query

func (is *InstrumentedStmt) Query(args []driver.Value) (driver.Rows, error)

func (*InstrumentedStmt) QueryContext

func (is *InstrumentedStmt) QueryContext(ctx context.Context,
	args []driver.NamedValue) (driver.Rows, error)

type PgConnectorWithRds

type PgConnectorWithRds struct {
	// contains filtered or unexported fields
}

func MakePgConnector

func MakePgConnector(ctx context.Context, connStr string, sslCaPath string,
	config aws.Config) (*PgConnectorWithRds, error)

Create a Postgres connector to use with XrayConnector. The PgConnector supports resolving RDS endpoints and IAM authentication.

func (*PgConnectorWithRds) Connect

func (pc *PgConnectorWithRds) Connect(ctx context.Context) (driver.Conn,
	*ConnInfo, error)

type SqliteConnector

type SqliteConnector struct {
	// contains filtered or unexported fields
}

func NewSqliteConnector

func NewSqliteConnector(connString string) *SqliteConnector

func (*SqliteConnector) Connect

func (s *SqliteConnector) Connect(ctx context.Context) (
	driver.Conn, *ConnInfo, error)

type XrayConnector

type XrayConnector struct {
	ConnProvider ConnectionProvider
}

func NewXrayConnector

func NewXrayConnector(connProvider ConnectionProvider) *XrayConnector

Create a new connector with AWS XRay instrumentation attached

func (*XrayConnector) Connect

func (ic *XrayConnector) Connect(ctx context.Context) (driver.Conn, error)

func (*XrayConnector) Driver

func (ic *XrayConnector) Driver() driver.Driver

Jump to

Keyboard shortcuts

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