api

package
v0.8.1-0...-8228e50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2014 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVERSION        = 1.9
	DEFAULTHTTPHOST   = "127.0.0.1"
	DEFAULTHTTPPORT   = 4243
	DEFAULTUNIXSOCKET = "/var/run/docker.sock"
)

Variables

This section is empty.

Functions

func AttachProfiler

func AttachProfiler(router *mux.Router)

func ListenAndServe

func ListenAndServe(proto, addr string, eng *engine.Engine, logging, enableCors bool, dockerVersion string) error

ListenAndServe sets up the required http.Server and gets it listening for each addr passed in and does protocol specific checking.

func MatchesContentType

func MatchesContentType(contentType, expectedType string) bool

func ServeApi

func ServeApi(job *engine.Job) engine.Status

ServeApi loops through all of the protocols sent in to docker and spawns off a go routine to setup a serving http.Server for each.

func ServeFd

func ServeFd(addr string, handle http.Handler) error

ServeFD creates an http.Server and sets it up to serve given a socket activated argument.

func ServeRequest

func ServeRequest(eng *engine.Engine, apiversion float64, w http.ResponseWriter, req *http.Request) error

ServeRequest processes a single http request to the docker remote api. FIXME: refactor this to be part of Server and not require re-creating a new router each time. This requires first moving ListenAndServe into Server.

Types

type HttpApiFunc

type HttpApiFunc func(eng *engine.Engine, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL