db

package
v0.0.0-...-1d6a714 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2012 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

This plugin provides a database transaction to the application. A transaction is begun before each request and committed on success. If a panic occurred during the request, the transaction is rolled back. (The application may also roll the transaction back itself.)

Index

Constants

This section is empty.

Variables

View Source
var (
	Db     *sql.DB
	Driver string
	Spec   string
)

Functions

This section is empty.

Types

type DbPlugin

type DbPlugin struct {
	rev.EmptyPlugin
}

func (DbPlugin) AfterRequest

func (p DbPlugin) AfterRequest(c *rev.Controller)

Commit the active transaction.

func (DbPlugin) BeforeRequest

func (p DbPlugin) BeforeRequest(c *rev.Controller)

Begin a transaction.

func (DbPlugin) OnAppStart

func (p DbPlugin) OnAppStart()

func (DbPlugin) OnException

func (p DbPlugin) OnException(c *rev.Controller, err interface{})

Rollback the active transaction, if any.

Jump to

Keyboard shortcuts

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