route_helpers

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UUIDPath     = "/{uuid:" + minecraft.ValidUUIDPlainRegex + "}"
	DashPath     = "/{dashedUUID:" + minecraft.ValidUUIDDashRegex + "}"
	UsernamePath = "/{username:" + minecraft.ValidUsernameRegex + "}"
	//UserPath     = "/{user:" + minecraft.ValidUsernameRegex + "|" + minecraft.ValidUUIDPlainRegex + "}"
	// We technically only allow up to size 300, but we'll fallback on larger
	WidthPath     = "{width:[0-9]{1,4}}"
	ExtensionPath = "{extension:(?:\\.png|\\.svg)?}"
)

Variables

This section is empty.

Functions

func CorsHandler

func CorsHandler(next http.Handler) http.Handler

func DashedRedirectUUIDHandler

func DashedRedirectUUIDHandler() http.Handler

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) func(http.Handler) http.Handler

func MuxToUserReq

func MuxToUserReq(r *http.Request) (userReq mcclient.UserReq)

var "username" or "uuid" _MUST_ be present

func SubRouteDashedRedirect

func SubRouteDashedRedirect(m *mux.Router, counter *prometheus.CounterVec)

Types

This section is empty.

Jump to

Keyboard shortcuts

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