gormcontroller

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 5 Imported by: 9

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 transition.

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