gormcontroller

package
v0.0.0-...-db4e6ed Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	*revel.Controller
	DB *gorm.DB
}

Controller is a Revel controller with a pointer to the opened database

type TxnController

type TxnController struct {
	*revel.Controller
	Txn *gorm.DB
}

TxnController is a Revel controller with database transaction support (begin, commit and rollback)

func (*TxnController) Begin

func (c *TxnController) Begin() revel.Result

Begin begins a DB transaction

func (*TxnController) Commit

func (c *TxnController) Commit() revel.Result

Commit commits the database transation

func (*TxnController) Rollback

func (c *TxnController) Rollback() revel.Result

Rollback rolls back the transaction (eg. after a panic)

Jump to

Keyboard shortcuts

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