storage

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameStorage

type GameStorage struct {
	// contains filtered or unexported fields
}

func NewGameStorage

func NewGameStorage(session *mgo.Session, databaseName string) *GameStorage

func (GameStorage) FindAllGamesForUser

func (storage GameStorage) FindAllGamesForUser(user model.User) (model.Games, error)

func (GameStorage) FindAllOpenGamesForUser

func (storage GameStorage) FindAllOpenGamesForUser(user model.User) (model.Games, error)

func (GameStorage) FindOne

func (storage GameStorage) FindOne(gameId string) (model.Game, error)

func (GameStorage) Insert

func (storage GameStorage) Insert(game *model.Game) error

func (GameStorage) JoinGame

func (storage GameStorage) JoinGame(game *model.Game, joiningUser model.User) error

func (GameStorage) Turn

func (storage GameStorage) Turn(game *model.Game, player model.User, position int) (model.Turn, error)

type UserStorage

type UserStorage struct {
	// contains filtered or unexported fields
}

func NewUserStorage

func NewUserStorage(session *mgo.Session, databaseName string) *UserStorage

func (UserStorage) FindByRef

func (storage UserStorage) FindByRef(ref mgo.DBRef) (model.User, error)

func (UserStorage) FindByUsername

func (storage UserStorage) FindByUsername(username string) (model.User, error)

func (UserStorage) Insert

func (storage UserStorage) Insert(user *model.User) error

Jump to

Keyboard shortcuts

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