util

package
v0.0.0-...-e92409c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: ISC Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorAndAbort

func ErrorAndAbort(w http.ResponseWriter, r *http.Request, status int, key string, errs ...error)

func ErrorAndDisconnect

func ErrorAndDisconnect(ctx context.Context, conn *websocket.Conn, err error)

func GenerateLobbyCode

func GenerateLobbyCode(ctx context.Context) string

func GeneratePeerID

func GeneratePeerID(ctx context.Context) string

func GenerateSecret

func GenerateSecret(ctx context.Context) string

func GenerateShortLobbyCode

func GenerateShortLobbyCode(ctx context.Context) string

func Getenv

func Getenv(key, def string) string

func IsPipeError

func IsPipeError(err error) bool

func IsUUID

func IsUUID(in string) bool

func Now

func Now(ctx context.Context) time.Time

func RenderJSON

func RenderJSON(w http.ResponseWriter, r *http.Request, status int, val interface{})

RenderJSON will write a json response to the given ResponseWriter.

func ReplyError

func ReplyError(ctx context.Context, conn *websocket.Conn, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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