gorm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(conf *Config) (*gorm.DB, error)

NewDB new gorm.DB

Types

type Config

type Config struct {
	Addr string
}

Config config for gorm

type DB

type DB struct {
	*gorm.DB
}

DB gorm.DB wrapper

func (*DB) RunInTransaction

func (db *DB) RunInTransaction(fn func(*Tx) error) error

RunInTransaction wraps function in db transaction

type Tx

type Tx struct {
	DB
}

Tx represents Transaction

Jump to

Keyboard shortcuts

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