mongo

package
v0.0.0-...-7d85d8e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(logger kitlog.Logger) (*mongo.Client, error)

NewClient creates a new mongo client.

func NewGameRepository

func NewGameRepository(client *mongo.Client) game.Repository

NewGameRepository returns implementation for game.Repository with mongo store.

func NewTicketRepository

func NewTicketRepository(client *mongo.Client) ticket.Repository

NewTicketRepository returns implementation for ticket.Repository with mongo store.

Types

type Game

type Game struct {
	ID      primitive.ObjectID `bson:"_id,omitempty"`
	Tickets []ticket.ID        `bson:"tickets,omitempty"`
	Numbers []int64            `bson:"numbers,omitempty"`
}

Game is model for storing games.

type Ticket

type Ticket struct {
	ID       primitive.ObjectID `bson:"_id,omitempty"`
	Username string             `bson:"username"`
	Cells    string             `bson:"cell"`
}

Ticket is model for storing tickets.

Jump to

Keyboard shortcuts

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