models

package
v0.0.0-...-0d888fa Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUEUED int = iota
	JUDGING
	AC
	WA
	RE
	TLE
	MLE
	CE
	ERR
)
View Source
const (
	LANGCPP int = iota
	LANGCPPCLANG
	LANGPYTHON3
	LANGGHC
	LANGSIZE
)
View Source
const (
	USERROLE int = iota
	ADMINROLE
)

Variables

This section is empty.

Functions

func EnsureDBIndices

func EnsureDBIndices(DB *mgo.Session) error

Types

type DBSession

type DBSession struct {
	*mgo.Session
}

func (DBSession) C

func (s DBSession) C(name string) *mgo.Collection

type DiscussPost

type DiscussPost struct {
	ID       bson.ObjectId `bson:"_id"`
	Content  string
	Username string
}

type Idx

type Idx struct {
	ID  string `bson:"_id"`
	Seq int
}

type Problem

type Problem struct {
	ID         int `bson:"_id"`
	Name       string
	Content    string
	AuthorName string `bson:"authorname"`
	Memlimit   int
	Timelimit  int
	Testdata   string
}

type Submission

type Submission struct {
	ID       bson.ObjectId `bson:"_id"`
	Pid      int
	Username string
	Verdict  Verdict
	Lang     int
	Content  string
}

type User

type User struct {
	ID              bson.ObjectId `bson:"_id"`
	Name            string
	Username        string
	Hashed_password []byte
	Role            int
}

func (*User) IsAdmin

func (u *User) IsAdmin() bool

type Verdict

type Verdict struct {
	Result   int
	Timeused int
	Memused  int
}

Jump to

Keyboard shortcuts

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