controllers

package
v0.0.0-...-d96fec9 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	ID   int
	Text string
}

type Event

type Event struct {
	Name             string
	NewCard          models.Card
	Totals           []Total
	State            models.MatchState
	InitialBlackCard models.BlackCard
	WinnerUsername   string
	WinnerText       string
	Leaderboard      []models.User
	Jury             []models.User
	Username         string
}

type SocketServer

type SocketServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func MakeSocketServer

func MakeSocketServer(e *echo.Echo, mm *game.MatchManager) SocketServer

func (*SocketServer) BroadcastToRoom

func (s *SocketServer) BroadcastToRoom(room int, msg interface{})

func (*SocketServer) Start

func (s *SocketServer) Start()

type Total

type Total struct {
	ID    int
	Votes int
}

type WebApp

type WebApp struct {
	MatchManager *game.MatchManager
	Echo         *echo.Echo
	Db           *gorp.DbMap
	Ws           SocketServer
}

func (*WebApp) Admin

func (w *WebApp) Admin(c echo.Context) error

func (*WebApp) AdminNewMatch

func (w *WebApp) AdminNewMatch(c echo.Context) error

func (*WebApp) AdminUsers

func (w *WebApp) AdminUsers(c echo.Context) error

func (*WebApp) DoLogin

func (w *WebApp) DoLogin(c echo.Context) error

func (*WebApp) DoSignUp

func (w *WebApp) DoSignUp(c echo.Context) error

func (*WebApp) EndVoting

func (w *WebApp) EndVoting(c echo.Context) error

func (*WebApp) GetLeaderboard

func (w *WebApp) GetLeaderboard(user_id int64) ([]models.User, error)

func (*WebApp) GetUserByUsername

func (w *WebApp) GetUserByUsername(username string) *models.User

func (*WebApp) Index

func (w *WebApp) Index(c echo.Context) error

func (*WebApp) JoinLatestMatch

func (w *WebApp) JoinLatestMatch(c echo.Context) error

func (*WebApp) JoinMatch

func (w *WebApp) JoinMatch(c echo.Context) error

func (*WebApp) Login

func (w *WebApp) Login(c echo.Context) error

func (*WebApp) Logout

func (w *WebApp) Logout(c echo.Context) error

func (*WebApp) MatchCards

func (w *WebApp) MatchCards(c echo.Context) error

func (*WebApp) Matches

func (w *WebApp) Matches(c echo.Context) error

func (*WebApp) NewBlackCard

func (w *WebApp) NewBlackCard(c echo.Context) error

func (*WebApp) PickCard

func (w *WebApp) PickCard(c echo.Context) error

func (*WebApp) SignUp

func (w *WebApp) SignUp(c echo.Context) error

func (*WebApp) VoteCard

func (w *WebApp) VoteCard(c echo.Context) error

Jump to

Keyboard shortcuts

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