repository

package
v0.0.0-...-18aef32 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	Startup()
	Shutdown()
	ExistsByID(id uuid.UUID) (exists bool, err error)
	Create(container model.Container) (err error)
	ResolveByIDs(ids []uuid.UUID) (containers []model.Container, err error)
	ResolveByPlayerID(playerID uuid.UUID) (containers []model.Container, err error)
	ResolvePage(pageNum int, pageSize int) (page *model.Page, err error)
	TxBulkUpdate(tx *sqlx.Tx, containers []model.Container) (err error)
}

Container is the Container repository interface

type ContainerMySQLRepo

type ContainerMySQLRepo struct {
	DB *database.MySQL `inject:"mysql"`
}

ContainerMySQLRepo is the repository for Containers implemented with MySQL backend

func (*ContainerMySQLRepo) Create

func (r *ContainerMySQLRepo) Create(container model.Container) (err error)

Create creates a new Container

func (*ContainerMySQLRepo) ExistsByID

func (r *ContainerMySQLRepo) ExistsByID(id uuid.UUID) (exists bool, err error)

ExistsByID checks whether a Container exists by its ID

func (*ContainerMySQLRepo) ResolveByIDs

func (r *ContainerMySQLRepo) ResolveByIDs(ids []uuid.UUID) (containers []model.Container, err error)

ResolveByIDs resolves Containers by their IDs

func (*ContainerMySQLRepo) ResolveByPlayerID

func (r *ContainerMySQLRepo) ResolveByPlayerID(playerID uuid.UUID) (containers []model.Container, err error)

ResolveByPlayerID resolves Containers by their Player IDs

func (*ContainerMySQLRepo) ResolvePage

func (r *ContainerMySQLRepo) ResolvePage(pageNum int, pageSize int) (page *model.Page, err error)

ResolvePage resolves a Page of Containers based on page and page size parameters

func (*ContainerMySQLRepo) Shutdown

func (r *ContainerMySQLRepo) Shutdown()

Shutdown cleans up everything and shuts down

func (*ContainerMySQLRepo) Startup

func (r *ContainerMySQLRepo) Startup()

Startup perform startup functions

func (*ContainerMySQLRepo) TxBulkUpdate

func (r *ContainerMySQLRepo) TxBulkUpdate(tx *sqlx.Tx, containers []model.Container) (err error)

TxBulkUpdate transactionally updates multiple containers with the transaction object passed from elsewhere

type Player

type Player interface {
	Startup()
	Shutdown()
	ExistsByID(id uuid.UUID) (exists bool, err error)
	Create(player model.Player) (err error)
	ResolveByID(id uuid.UUID) (player *model.Player, err error)
	ResolvePage(pageNum int, pageSize int) (page *model.Page, err error)
	TxUpdate(tx *sqlx.Tx, player model.Player) (err error)
}

Player is the Player repository interface

type PlayerMySQLRepo

type PlayerMySQLRepo struct {
	DB *database.MySQL `inject:"mysql"`
}

PlayerMySQLRepo is the repository for Players implemented with MySQL backend

func (*PlayerMySQLRepo) Create

func (r *PlayerMySQLRepo) Create(player model.Player) (err error)

Create creates a new Player

func (*PlayerMySQLRepo) ExistsByID

func (r *PlayerMySQLRepo) ExistsByID(id uuid.UUID) (exists bool, err error)

ExistsByID checks whether a Player exists by its ID

func (*PlayerMySQLRepo) ResolveByID

func (r *PlayerMySQLRepo) ResolveByID(id uuid.UUID) (player *model.Player, err error)

ResolveByID resolves a Player by its ID

func (*PlayerMySQLRepo) ResolvePage

func (r *PlayerMySQLRepo) ResolvePage(pageNum int, pageSize int) (page *model.Page, err error)

ResolvePage resolves a Page of Players based on page and page size parameters

func (*PlayerMySQLRepo) Shutdown

func (r *PlayerMySQLRepo) Shutdown()

Shutdown cleans up everything and shuts down

func (*PlayerMySQLRepo) Startup

func (r *PlayerMySQLRepo) Startup()

Startup performs startup functions

func (*PlayerMySQLRepo) TxUpdate

func (r *PlayerMySQLRepo) TxUpdate(tx *sqlx.Tx, player model.Player) (err error)

TxUpdate transactionally updates a Player with the transaction object passed from elsewhere

Jump to

Keyboard shortcuts

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