models

package
v0.0.0-...-5a82cd8 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	ID      primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Name    string             `json:"name"`
	Entries []Score            `json:"entries"`
}

func (Board) GetByID

func (b Board) GetByID(id string) (Board, error)

func (Board) PostBoard

func (b Board) PostBoard(name string) (Board, error)

type Score

type Score struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	BoardId  string             `bson:"board_id" json:"board_id"`
	Score    int                `json:"score"`
	ScoredAt time.Time          `json:"scored_at"`
	UserId   string             `bson:"user_id" json:"user_id"`
}

func (Score) PostScore

func (b Score) PostScore(score Score) (Score, error)

type ScoreToAdd

type ScoreToAdd struct {
	Score int `json:"score_to_add"`
}

type User

type User struct {
	ID   primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Name string             `json:"name"`
}

func (User) GetByID

func (h User) GetByID(id string) (User, error)

func (User) PostUser

func (h User) PostUser(name string) (User, error)

Jump to

Keyboard shortcuts

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