Documentation ¶
Index ¶
- func FetchDictionary(finderUrl string, query bson.M, limit int) (german.Dictionary, int, error)
- func FetchWords(finderUrl string, query bson.M, limit int) ([]entity.Word, int, error)
- func Main(name, version, defaultPort string, gameServer GameServer)
- func SaveAnswer(id string, wordIds, right []string, mgoCollection *mgo.Collection) error
- func ScoreWords(scorerUrl string, score int, ids []string)
- type Game
- type GameAnswer
- type GameDebug
- type GameOption
- type GameServer
- type Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchDictionary ¶
func FetchWords ¶
func Main ¶
func Main(name, version, defaultPort string, gameServer GameServer)
func SaveAnswer ¶
func ScoreWords ¶
Types ¶
type GameAnswer ¶
type GameAnswer struct { GameDebug Question string `bson:"question" json:"question"` Id string `json:"id,omitempty" bson:"id,omitempty"` }
func NewGameAnswer ¶
func NewGameAnswer() GameAnswer
func (GameAnswer) GetId ¶
func (g GameAnswer) GetId() string
func (GameAnswer) GetQuestion ¶
func (g GameAnswer) GetQuestion() string
type GameDebug ¶
type GameDebug struct { Error string `json:"error,omitempty" bson:"error,omitempty"` Query *bson.M `json:"query,omitempty" bson:"query,omitempty"` Dictionary *german.Dictionary `json:"dictionary,omitempty" bson:"dictionary,omitempty"` Word entity.Word `json:"word,omitempty" bson:"word,omitempty"` Options *bson.M `json:"options,omitempty" bson:"options,omitempty"` Right []string `json:"right,omitempty" bson:"right,omitempty"` English []entity.Meaning `json:"english,omitempty" bson:",omitempty"` Third []entity.Meaning `json:"third,omitempty" bson:"third,omitempty"` }
func (*GameDebug) SetDebugQuery ¶
type GameOption ¶
type GameOption struct { GameDebug Question string `json:"question" bson:"question"` Option1 string `json:"option1,omitempty" bson:"option1,omitempty"` Option2 string `json:"option2,omitempty" bson:"option2,omitempty"` Option3 string `json:"option3,omitempty" bson:"option3,omitempty"` Option4 string `json:"option4,omitempty" bson:"option4,omitempty"` Id string `json:"id,omitempty" bson:"id,omitempty"` }
func NewGameOption ¶
func NewGameOption() GameOption
func (GameOption) GetId ¶
func (g GameOption) GetId() string
func (GameOption) GetQuestion ¶
func (g GameOption) GetQuestion() string
type GameServer ¶
type Tracker ¶
type Tracker struct { Id string `json:"_id,omitempty" bson:"_id,omitempty"` WordIds []string `json:"wordIds,omitempty" bson:"wordIds,omitempty"` Right []string `json:"right,omitempty" bson:"right,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` }
func FindAnswer ¶
Click to show internal directories.
Click to hide internal directories.