db

package
v0.0.0-...-76b2090 Latest Latest
Warning

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

Go to latest
Published: May 15, 2013 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 {
	revel.EmptyPlugin
}

func (DbPlugin) AfterRequest

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

Commit the active transaction.

func (DbPlugin) BeforeRequest

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

Begin a transaction.

func (DbPlugin) OnAppStart

func (p DbPlugin) OnAppStart()

func (DbPlugin) OnException

func (p DbPlugin) OnException(c *revel.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