models

package
v0.1.3-beta Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2016 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	PermissionBanned = 1 << iota
	PermissionModerator
	PermissionAdmin
)

User Permissions

Variables

This section is empty.

Functions

func CreateDB

func CreateDB() (gorm.DB, error)

CreateDB creates an instance of a Gorm database.

func Migrate

func Migrate(db gorm.DB) error

Migrate automatically migrates the passed database to the latest version.

Types

type DBVer

type DBVer struct {
	ID      int
	Version uint64 // as it's a UNIX timestamp, we need to take something high.
}

DBVer is a struct which only scope is to help manage migrations.

type User

type User struct {
	ID          int
	Username    string `sql:"size:20"`
	Permissions uint32
	Email       string
	Password    string
}

User is an user on bancho.

Jump to

Keyboard shortcuts

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