models

package
v0.0.0-...-e030966 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 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 Game

type Game struct {
	ID          primitive.ObjectID `bson:"_id"`
	Code        string             `bson:"code"`
	CreatedAt   time.Time          `bson:"created_at"`
	Player1Name string             `bson:"player1_name"`
	Player2Name string             `bson:"player2_name"`
	Player1Addr string             `bson:"player1_addr"`
	Player2Addr string             `bson:"player2_addr"`
	Moves       []string           `bson:"moves"`
}

type GameModel

type GameModel struct {
	DB *mongo.Collection
}

func (*GameModel) Get

func (g *GameModel) Get(id string) (*Game, error)

func (*GameModel) Insert

func (g *GameModel) Insert(game *Game) error

func (*GameModel) Update

func (g *GameModel) Update(game *Game) error

type Model

type Model struct {
	Games GameModel
}

func CreateModel

func CreateModel(c1 *mongo.Collection) *Model

Jump to

Keyboard shortcuts

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