common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseTmplPath = "templates/base.html"
)

Variables

View Source
var IndexTmpl = tmplParseWithBase("templates/index.html")
View Source
var JoinFormTmpl = IndexTmpl.Lookup("join-form")

Template for joining a session/lobby

View Source
var NotFoundTmpl = tmplParseWithBase("templates/not-found.html")

Functions

func DebugOn

func DebugOn() bool

DebugOn returns true if the DEBUG environment variable is set to true or 1.

func DevMode

func DevMode() bool

DevMode returns true if not in production.

func ErrorHandler

func ErrorHandler(w http.ResponseWriter, r *http.Request, status int)

ErrorHandler handles HTTP errors based on the status code.

func NotFoundHandler

func NotFoundHandler(w http.ResponseWriter, r *http.Request)

func ParseTmplWithFuncs

func ParseTmplWithFuncs(path string) *template.Template

func ProdMode

func ProdMode() bool

Types

type HX_Headers

type HX_Headers struct {
	HxCurrentURL  string `json:"HX-Current-URL"`
	HxRequest     string `json:"HX-Request"`
	HxTarget      string `json:"HX-Target"`
	HxTrigger     string `json:"HX-Trigger"`
	HxTriggerName string `json:"HX-Trigger-Name"`
}

type JoinFormData

type JoinFormData struct {
	GamePinError string
}

Jump to

Keyboard shortcuts

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