Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORSMiddleware ¶
type CORSMiddleware struct {
// contains filtered or unexported fields
}
CORSMiddleware injects CORS headers to each request when it's configured.
func NewCORSMiddleware ¶
func NewCORSMiddleware(d string) CORSMiddleware
NewCORSMiddleware creates a new CORSMiddleware 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 Middleware interface {
WrapHandler(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
}
Middleware is an interface to allow the use of ordinary functions as Docker API filters. Any struct that has the appropriate signature can be registered as a middleware.
Click to show internal directories.
Click to hide internal directories.