handlers

package
v0.0.0-...-14894be Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// SessionTokenCookieKey is the key for the session token cookie.
	SessionTokenCookieKey = "session_token"
	ExpiresDuration       = 24 * time.Hour
)

Variables

This section is empty.

Functions

func GetNonce

func GetNonce(c echo.Context) domain.Nonce

func GetUserFromContext

func GetUserFromContext(c echo.Context) (db.User, error)

func Redirect

func Redirect(c echo.Context, path string, statusCode int) error

func RedirectToErrorPage

func RedirectToErrorPage(c echo.Context, errorCode int) error

func Render

func Render(c echo.Context, _ int, t templ.Component) error

func SetUserToContext

func SetUserToContext(c echo.Context, user db.User)

Types

type BetController

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

func NewBetController

func NewBetController(useCase bet.IUseCase) BetController

type JwtMiddleware

type JwtMiddleware struct {
	user.IUseCase
}

JwtMiddleware is the controller for the jwt routes.

func NewJwtMiddleware

func NewJwtMiddleware(user user.IUseCase) JwtMiddleware

NewJwtController creates a new jwt controller.

func (*JwtMiddleware) AuthorizeUser

func (j *JwtMiddleware) AuthorizeUser(next echo.HandlerFunc) echo.HandlerFunc

func (*JwtMiddleware) IsConnectedMiddleware

func (j *JwtMiddleware) IsConnectedMiddleware(_ domain.Permission, next echo.HandlerFunc) func(c echo.Context) error

type MatchController

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

func NewMatchController

func NewMatchController(useCase match.IUseCase) MatchController

func (*MatchController) GetUpcomingMatchByTournament

func (mc *MatchController) GetUpcomingMatchByTournament(c echo.Context) error

type PageController

type PageController struct{}

func NewPageController

func NewPageController() *PageController

func (*PageController) GetAdmin

func (p *PageController) GetAdmin(c echo.Context) error

func (*PageController) GetHome

func (p *PageController) GetHome(c echo.Context) error

func (*PageController) GetIndex

func (p *PageController) GetIndex(c echo.Context) error

func (*PageController) GetTournament

func (p *PageController) GetTournament(c echo.Context) error

type TournamentController

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

func NewTournamentController

func NewTournamentController(useCase tournament.IUseCase) TournamentController

func (*TournamentController) CreateTournamentFromLichessID

func (tc *TournamentController) CreateTournamentFromLichessID(c echo.Context) error

func (*TournamentController) GetTournamentByID

func (tc *TournamentController) GetTournamentByID(c echo.Context) error

func (*TournamentController) GetTournamentsInProgress

func (tc *TournamentController) GetTournamentsInProgress(c echo.Context) error

type UserController

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

func NewUserController

func NewUserController(user user.IUseCase) UserController

func (*UserController) DiscordCallback

func (uc *UserController) DiscordCallback(c echo.Context) error

func (*UserController) DiscordLogin

func (uc *UserController) DiscordLogin(c echo.Context) error

Jump to

Keyboard shortcuts

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