db

package
v0.0.0-...-92f7cd3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectLoop

func ConnectLoop(dialect string, dsn string, timeout time.Duration) (*gorm.DB, error)

ConnectLoop is the func for connection in a loop with timeout

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is the struct for a DB connection

func New

func New(conf config.DB, logger log.ILogger) (*DB, error)

New creates a new DB connection

func (*DB) AutoMigrateAll

func (db *DB) AutoMigrateAll()

AutoMigrateAll is the func for auto migration for all entities

func (*DB) DB

func (db *DB) DB() *gorm.DB

DB returns a db object

type IDB

type IDB interface {
	DB() *gorm.DB
}

IDB is the interface for a DB connection

Jump to

Keyboard shortcuts

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