Documentation ¶
Index ¶
- func GenUid() string
- func InitMysql() (err error)
- type Interface
- type Mysql
- func (m Mysql) CreateRoom(room *model.Room) (roomId int64, err error)
- func (m Mysql) GetOrCreatePlayer(uid string) (r model.Player, err error)
- func (m Mysql) GetPlayer(playerId int64) (r model.Player, exist bool, err error)
- func (m Mysql) GetPlayerByRoomId(roomId int64) (r []model.Player, err error)
- func (m Mysql) GetRoom(roomId int64) (room model.Room, exist bool, err error)
- func (m Mysql) SaveRoom(room *model.Room) (err error)
- func (m Mysql) UpdatePlayer(p *model.Player) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) }
type Mysql ¶
type Mysql struct {
// contains filtered or unexported fields
}
func (Mysql) GetOrCreatePlayer ¶
func (Mysql) GetPlayerByRoomId ¶
Click to show internal directories.
Click to hide internal directories.