repository

package
v0.0.0-...-292fe0d Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenUid

func GenUid() string

func InitMysql

func InitMysql() (err error)

Types

type Interface

type Interface interface {
	CreateRoom(room *model.Room) (roomId int64, err error)
	GetRoom(roomId int64) (room model.Room, exist bool, err error)
	SaveRoom(room *model.Room) (err error)

	UpdatePlayer(p *model.Player) (err error)
	GetPlayerByRoomId(roomId int64) (r []model.Player, err error)
	GetPlayer(playerId int64) (r model.Player, exist bool, err error)

	GetOrCreatePlayer(uid string) (r model.Player, err error)
}

func NewMysql

func NewMysql() Interface

type Mysql

type Mysql struct {
	// contains filtered or unexported fields
}

func (Mysql) CreateRoom

func (m Mysql) CreateRoom(room *model.Room) (roomId int64, err error)

func (Mysql) GetOrCreatePlayer

func (m Mysql) GetOrCreatePlayer(uid string) (r model.Player, err error)

func (Mysql) GetPlayer

func (m Mysql) GetPlayer(playerId int64) (r model.Player, exist bool, err error)

func (Mysql) GetPlayerByRoomId

func (m Mysql) GetPlayerByRoomId(roomId int64) (r []model.Player, err error)

func (Mysql) GetRoom

func (m Mysql) GetRoom(roomId int64) (room model.Room, exist bool, err error)

func (Mysql) SaveRoom

func (m Mysql) SaveRoom(room *model.Room) (err error)

func (Mysql) UpdatePlayer

func (m Mysql) UpdatePlayer(p *model.Player) (err error)

Jump to

Keyboard shortcuts

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