docker: github.com/docker/docker/api/server/middleware Index | Files

package middleware

import "github.com/docker/docker/api/server/middleware"

Index

Package Files

cors.go debug.go experimental.go middleware.go version.go

func DebugRequestMiddleware Uses

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

type CORSMiddleware Uses

type CORSMiddleware struct {
    // contains filtered or unexported fields
}

CORSMiddleware injects CORS headers to each request when it's configured.

func NewCORSMiddleware Uses

func NewCORSMiddleware(d string) CORSMiddleware

NewCORSMiddleware creates a new CORSMiddleware with default headers.

func (CORSMiddleware) WrapHandler Uses

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 ExperimentalMiddleware Uses

type ExperimentalMiddleware struct {
    // contains filtered or unexported fields
}

ExperimentalMiddleware is a the middleware in charge of adding the 'Docker-Experimental' header to every outgoing request

func NewExperimentalMiddleware Uses

func NewExperimentalMiddleware(experimentalEnabled bool) ExperimentalMiddleware

NewExperimentalMiddleware creates a new ExperimentalMiddleware

func (ExperimentalMiddleware) WrapHandler Uses

func (e ExperimentalMiddleware) 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 Uses

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.

type VersionMiddleware Uses

type VersionMiddleware struct {
    // contains filtered or unexported fields
}

VersionMiddleware is a middleware that validates the client and server versions.

func NewVersionMiddleware Uses

func NewVersionMiddleware(s, d, m string) VersionMiddleware

NewVersionMiddleware creates a new VersionMiddleware with the default versions.

func (VersionMiddleware) WrapHandler Uses

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.

Package middleware imports 12 packages (graph) and is imported by 323 packages. Updated 2020-02-27. Refresh now. Tools for package owners.