database

package
v0.0.0-...-7544200 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *pg.DB
View Source
var Models = []interface{}{
	&User{},
	&Role{},
}

All database models

Functions

func Database

func Database() *pg.DB

func Init

func Init()

Initialize the database connection and set up migrations, if necessary.

Types

type Role

type Role struct {
	Id      int
	UserId  int
	Name    string
	IsAdmin bool
	IsGod   bool
}

type User

type User struct {
	Id         int `sql:",pk"`
	Name       string
	Email      string
	Password   []uint8
	Role       *Role
	IsFacebook bool
	IsGoogle   bool
}

Jump to

Keyboard shortcuts

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