db

package
v0.0.0-...-430806f Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2013 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package monitor/db decorates database/sql drivers with query logging and timings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterNewDriver

func RegisterNewDriver(newname string, driver driver.Driver, mf DatabaseMonitor)

Types

type DatabaseMonitor

type DatabaseMonitor interface {
	OnEvent(MonitorResult)
}

type MonitorResult

type MonitorResult struct {
	Description string
	Duration    time.Duration
}

type MonitoredConn

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

func (MonitoredConn) Begin

func (c MonitoredConn) Begin() (driver.Tx, error)

func (MonitoredConn) Close

func (c MonitoredConn) Close() error

func (MonitoredConn) Prepare

func (c MonitoredConn) Prepare(query string) (driver.Stmt, error)

type MonitoredDriver

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

func (MonitoredDriver) Open

func (md MonitoredDriver) Open(name string) (driver.Conn, error)

type MonitoredStmt

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

func (MonitoredStmt) Close

func (c MonitoredStmt) Close() error

func (MonitoredStmt) Exec

func (c MonitoredStmt) Exec(args []driver.Value) (driver.Result, error)

func (MonitoredStmt) NumInput

func (c MonitoredStmt) NumInput() int

func (MonitoredStmt) Query

func (c MonitoredStmt) Query(args []driver.Value) (driver.Rows, error)

type MonitoredTx

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

func (MonitoredTx) Commit

func (c MonitoredTx) Commit() error

func (MonitoredTx) Rollback

func (c MonitoredTx) Rollback() error

Jump to

Keyboard shortcuts

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