models

package
v0.0.0-...-9b4f6c4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegisteredGroup = 0 // User's Group field default value
	WorkerGroup     = 1
	AdminGroup      = 2
)

user groups

Variables

This section is empty.

Functions

func CreateTables

func CreateTables() error

func CreateUser

func CreateUser(username, password string) error

Types

type Contest

type Contest struct {
	Id int
}

type Problem

type Problem struct {
	Id int
}

type Submission

type Submission struct {
	Id int
}

type Task

type Task struct {
	Id int
}

type User

type User struct {
	Id           int
	Group        int8   `sql:",notnull,default:0"` // RegisteredGroup
	Username     string `sql:",notnull,unique,type:varchar(255)"`
	PasswordHash []byte `sql:",notnull"`
}

this table is read-heavy!

func GetUserByCredentials

func GetUserByCredentials(username, password string) (*User, error)

Jump to

Keyboard shortcuts

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