handler

package
v0.0.0-...-e36e409 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Regexps = map[string]*regexp2.Regexp{
	"USERNAME": regexp2.MustCompile("^(?!_)(?![0-9]+$)[a-zA-Z0-9_]+(?<!_)$", 0),
	"PASSWORD": regexp2.MustCompile("^(?![0-9]+$)(?![a-zA-Z]+$)(?=[A-Za-z])[0-9A-Za-z]{6,16}$", 0),
}

Functions

func CreateRoom

func CreateRoom(c echo.Context) error

func DBNotFound

func DBNotFound(err error, msg string) error

func ExitRoom

func ExitRoom(c echo.Context) error

func GameEvent

func GameEvent(c echo.Context) error

func GetCurrentGame

func GetCurrentGame(c echo.Context) (*game.Game, error)

func GetCurrentPlayer

func GetCurrentPlayer(c echo.Context) (*model.Player, error)

func GetCurrentRoom

func GetCurrentRoom(c echo.Context) (*model.Room, error)

func GetCurrentUser

func GetCurrentUser(c echo.Context) (*model.User, error)

func GetDB

func GetDB(e echo.Context) *gorm.DB

func GetGameList

func GetGameList(c echo.Context) error

func GetPlayer

func GetPlayer(c echo.Context) error

func GetPlayerByID

func GetPlayerByID(c echo.Context) error

func GetProfile

func GetProfile(c echo.Context) error

func GetProfileById

func GetProfileById(c echo.Context) error

func GetRoom

func GetRoom(c echo.Context) error

func GetRoomByID

func GetRoomByID(c echo.Context) error

func GetUser

func GetUser(c echo.Context) error

func GetUserById

func GetUserById(c echo.Context) error

func IntParam

func IntParam(c echo.Context, name string) int

func JoinRoom

func JoinRoom(c echo.Context) error

func Login

func Login(c echo.Context) error

func LoginOpenid

func LoginOpenid(c echo.Context, param LoginParam) error

func LoginPassword

func LoginPassword(c echo.Context, param LoginParam) error

func Logout

func Logout(c echo.Context) error

func NewValidator

func NewValidator() echo.Validator

func Ready

func Ready(c echo.Context) error

func RoomSSE

func RoomSSE(c echo.Context) error

func RoomSocket

func RoomSocket(c echo.Context) error

func SignUp

func SignUp(c echo.Context) error

func StartGame

func StartGame(c echo.Context) error

func SwapSeat

func SwapSeat(c echo.Context) error

func UpdateProfile

func UpdateProfile(c echo.Context) error

Types

type LoginParam

type LoginParam struct {
	Type     string `json:"type" form:"type" query:"type"`
	Username string `json:"username" form:"username" query:"username" validate:"regexp=USERNAME"`
	Password string `json:"password" form:"password" query:"password"`
	Provider string `json:"provider" form:"provider" query:"provider"`
	Token    string `json:"token" form:"token" query:"token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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