nrsql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(db *sql.DB, opts ...Option) isql.DB

Wrap wraps a *sql.DB object to measure performances and sent them to New Relic.

Types

type Config

type Config struct {
	Datastore    newrelic.DatastoreProduct
	DBName       string
	Host         string
	PortPathOrID string
}

Config contains metadata to send to New Relic.

type Option

type Option func(*Config)

Option configures a Config object.

func WithDBName

func WithDBName(dbName string) Option

WithDBName sets a DB name.

func WithDatastore

func WithDatastore(d newrelic.DatastoreProduct) Option

WithDatastore sets a datestore type.

func WithHost

func WithHost(host string) Option

WithHost sets a DB host.

func WithPortPathOrID

func WithPortPathOrID(v string) Option

WithPortPathOrID sets a DB port, path or id.

type Stmt

type Stmt interface {
	isql.Stmt
	// contains filtered or unexported methods
}

Stmt wraps a *sql.Stmt object.

Jump to

Keyboard shortcuts

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