Documentation ¶
Index ¶
- Variables
- func Blob[T ~[]byte | ~string](body T, contentType string, status int) http.HandlerFunc
- func JSON(value any, status int) http.HandlerFunc
- func Redirect(to string, permanent ...bool) http.HandlerFunc
- func Serve(ctx context.Context, options ServeOption) (port int, err error)
- func UseBasicAuth(r Router, username, password string)
- type Router
- type ServeOption
Constants ¶
This section is empty.
Variables ¶
View Source
var Recoverer = middleware.Recoverer
Recoverer is a middleware that recovers from panics, logs the panic (and a backtrace), and returns a HTTP 500 (Internal Server Error) status if possible. Recoverer prints a request ID if one is provided.
Alternatively, look at https://github.com/go-chi/httplog middleware pkgs.
Functions ¶
func UseBasicAuth ¶
UseBasicAuth implements a simple middleware handler for adding basic http auth to a route.
Types ¶
Click to show internal directories.
Click to hide internal directories.