database

package
v0.0.0-...-4061f55 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close current database connection

func DB

func DB() *gorm.DB

DB returns the current database connection

func Setup

func Setup(config Config, tables []interface{}, fks ...FKey) error

Setup database (connection, migrations)

Types

type Config

type Config struct {
	Host     string
	Port     int
	Database string
	Username string
	Password string
}

Config for the database.

type FKey

type FKey struct {
	Model interface{}
	Args  [4]string
}

FKey is a foreign key descriptor.

Jump to

Keyboard shortcuts

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