Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugRequestMiddleware ¶
func DebugRequestMiddleware(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error) func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error
DebugRequestMiddleware dumps the request to logger
Types ¶
type CORSMiddleware ¶
type CORSMiddleware struct {
// contains filtered or unexported fields
}
CORSMiddlware injects CORS headers to each request when it's configured.
func NewCORSMiddleware ¶
func NewCORSMiddleware(d string) CORSMiddleware
NewCORSMiddleware creates a new NewCORSMiddleware with default headers.
func (CORSMiddleware) WrapHandler ¶
func (c CORSMiddleware) WrapHandler(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error) func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error
WrapHandler returns a new handler function wrapping the previous one in the request chain.
type Middleware ¶
type VersionMiddleware ¶
type VersionMiddleware struct {
// contains filtered or unexported fields
}
VersionMiddleware is a middleware that validates the client and server versions.
func NewVersionMiddleware ¶
func NewVersionMiddleware(s, d, m string) VersionMiddleware
NewVersionMiddleware creates a new VersionMiddleware with the default versions.
func (VersionMiddleware) WrapHandler ¶
func (v VersionMiddleware) WrapHandler(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error) func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error
WrapHandler returns a new handler function wrapping the previous one in the request chain.
Click to show internal directories.
Click to hide internal directories.