Documentation ¶
Index ¶
- Variables
- func CORS() func(next http.Handler) http.Handler
- func CORSWithConfig(config CORSConfig) func(next http.Handler) http.Handler
- func Chain(middlewares ...func(next http.Handler) http.Handler) func(next http.Handler) http.Handler
- func Context() func(next http.Handler) http.Handler
- func Debug(prefix string) http.Handler
- func Documentation(name, prefix string, spec []byte) http.Handler
- func Error(r *http.Request, err error)
- func Get[T any](r *http.Request, key string) (val T, ok bool)
- func GetError(r *http.Request) error
- func Set[T any](r *http.Request, key string, value T)
- type CORSConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = CORSConfig{ AllowOrigin: "*", AllowMethods: []string{ http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete, }, }
Functions ¶
func CORSWithConfig ¶
func CORSWithConfig(config CORSConfig) func(next http.Handler) http.Handler
Types ¶
type CORSConfig ¶
Click to show internal directories.
Click to hide internal directories.