Documentation
¶
Index ¶
- func ErrorAndAbort(w http.ResponseWriter, r *http.Request, status int, key string, errs ...error)
- func ErrorAndDisconnect(ctx context.Context, conn *websocket.Conn, err error)
- func ErrorWithCode(err error, code string) error
- func GenerateLobbyCode(ctx context.Context) string
- func GeneratePeerID(ctx context.Context) string
- func GenerateSecret(ctx context.Context) string
- func GenerateShortLobbyCode(ctx context.Context, chars int) string
- func Getenv(key, def string) string
- func IsUUID(in string) bool
- func NoStoreMiddleware(next http.Handler) http.Handler
- func NowUTC(ctx context.Context) time.Time
- func RenderJSON(w http.ResponseWriter, r *http.Request, status int, val any)
- func ReplyError(ctx context.Context, conn *websocket.Conn, err error)
- func ShouldIgnoreNetworkError(err error) bool
- func WithRequestID(ctx context.Context, id string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorAndAbort ¶
func ErrorAndDisconnect ¶
func ErrorWithCode ¶
func GenerateLobbyCode ¶
func GeneratePeerID ¶
func GenerateSecret ¶
func GenerateShortLobbyCode ¶
GenerateShortLobbyCode generates a short lobby code with the given number of characters. The code is generated using al alpabet of characters that are easy to distinguish from each other (e.g. no 0 and O).
func RenderJSON ¶
RenderJSON will write a json response to the given ResponseWriter.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.