model

package
v0.0.0-...-a8b15d2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	ID             bson.ObjectId `bson:"_id"`
	FirstPlayer    mgo.DBRef     `bson:"firstPlayer"`
	SecondPlayer   mgo.DBRef     `bson:"secondPlayer,omitempty"`
	StartingPlayer mgo.DBRef     `bson:"startingPlayer,omitempty"`
	Winner         mgo.DBRef     `bson:"winner,omitempty"`
	CreateDate     time.Time     `bson:"createDate"`
	StartDate      time.Time     `bson:"startDate,omitempty"`
	EndDate        time.Time     `bson:"endDate,omitempty"`
	TurnCount      int           `bson:"turnCount"`
}

func (Game) DBRef

func (game Game) DBRef() mgo.DBRef

type Games

type Games []Game

type Turn

type Turn struct {
	ID              bson.ObjectId `bson:"_id"`
	Game            mgo.DBRef     `bson:"game"`
	Player          mgo.DBRef     `bson:"player"`
	Position        int           `bson:"position"`
	PositionInField int           `bson:"positionInField"`
	Field           int           `bson:"field"`
	NextField       int           `bson:"nextField"`
	RandomField     bool          `bson:"randomField"`
	TurnCount       int           `bson:"turnCount"`
	WonField        bool          `bson:"wonField"`
	WonGame         bool          `bson:"wonGame"`
	CreateDate      time.Time     `bson:"createDate"`
}

type Turns

type Turns []Turn

type User

type User struct {
	ID       bson.ObjectId `bson:"_id"`
	Username string        `bson:"username" validate:"required,min=3,max=20,excludesall=!@#$%^&*()_+-=:;?/0x2C"`
}

func (User) DBRef

func (user User) DBRef() mgo.DBRef

func (User) Valid

func (user User) Valid() error

Jump to

Keyboard shortcuts

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