matchservice

package
v0.0.0-...-07dc107 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllMatches

func AllMatches(request *restful.Request, response *restful.Response)

func CreateMatch

func CreateMatch(request *restful.Request, response *restful.Response)

func FindMatch

func FindMatch(request *restful.Request, response *restful.Response)

func New

func New(pRepo playerservice.PlayerRepository) *restful.WebService

func RemoveMatch

func RemoveMatch(request *restful.Request, response *restful.Response)

func SaveMatch

func SaveMatch(usr Match)

func ValidateMatch

func ValidateMatch(match Match) error

func ValidatePlayersInMatch

func ValidatePlayersInMatch(match Match)

Types

type Match

type Match struct {
	PlayerOne, PlayerTwo, PlayerThree, PlayerFour string
	ScoreOne, ScoreTwo                            int8
	PlayedAt                                      time.Time
}

type MatchRepository

type MatchRepository interface {
	SaveMatch(match Match)
	FindMatch(id string) Match
	FindAllMatches() []Match
}

type MongoMatchRepository

type MongoMatchRepository struct {
}

func (MongoMatchRepository) FindAllMatches

func (m MongoMatchRepository) FindAllMatches() []Match

func (MongoMatchRepository) FindMatch

func (m MongoMatchRepository) FindMatch(id string) Match

func (MongoMatchRepository) MatchCollection

func (m MongoMatchRepository) MatchCollection() (*mgo.Collection, *mgo.Session)

func (MongoMatchRepository) SaveMatch

func (m MongoMatchRepository) SaveMatch(match Match)

Jump to

Keyboard shortcuts

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