import "github.com/docker/docker/api/server/httputils"
decoder.go errors_deprecated.go form.go httputils.go httputils_write_json.go write_log_stream.go
BoolValue transforms a form value in different formats into a boolean type.
BoolValueOrDefault returns the default bool passed if the query param is missing, otherwise it's just a proxy to boolValue above.
CheckForJSON makes sure that the request's Content-Type is application/json.
func CloseStreams(streams ...interface{})
CloseStreams ensures that a list for http streams are properly closed.
GetHTTPErrorStatusCode retrieves status code from error message.
Deprecated: use errdefs.GetHTTPErrorStatusCode
func HijackConnection(w http.ResponseWriter) (io.ReadCloser, io.Writer, error)
HijackConnection interrupts the http response writer to get the underlying connection and operate with it.
Int64ValueOrDefault parses a form value into an int64 type. If there is an error, returns the error. If there is no value returns the default value.
Int64ValueOrZero parses a form value into an int64 type. It returns 0 if the parsing fails.
func MakeErrorHandler(err error) http.HandlerFunc
MakeErrorHandler makes an HTTP handler that decodes a Docker error and returns it in the response.
ParseForm ensures the request form is parsed even with invalid content types. If we don't do this, POST method without Content-type (even with empty body) will fail.
VersionFromContext returns an API version from the context using APIVersionKey. It panics if the context value does not have version.Version type.
func WriteJSON(w http.ResponseWriter, code int, v interface{}) error
WriteJSON writes the value v to the http response stream as json with standard json encoding.
func WriteLogStream(_ context.Context, w io.Writer, msgs <-chan *backend.LogMessage, config *types.ContainerLogsOptions, mux bool)
WriteLogStream writes an encoded byte stream of log messages from the messages channel, multiplexing them with a stdcopy.Writer if mux is true
type APIFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error
APIFunc is an adapter to allow the use of ordinary functions as Docker API endpoints. Any function that has the appropriate signature can be registered as an API endpoint (e.g. getVersion).
type APIVersionKey struct{}
APIVersionKey is the client's requested API version.
ArchiveOptions stores archive information for different operations.
ArchiveFormValues parses form values and turns them into ArchiveOptions. It fails if the archive name and path are not in the request.
type ContainerDecoder interface { DecodeConfig(src io.Reader) (*container.Config, *container.HostConfig, *network.NetworkingConfig, error) DecodeHostConfig(src io.Reader) (*container.HostConfig, error) }
ContainerDecoder specifies how to translate an io.Reader into container configuration.
Package httputils imports 23 packages (graph) and is imported by 4439 packages. Updated 2019-10-28. Refresh now. Tools for package owners.