server

package
v0.0.0-...-2677422 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2016 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerRoutes = map[string]map[string]HttpApiFunc{
	"GET": {
		"/_ping":                          GetCatchAll,
		"/events":                         GetCatchAll,
		"/info":                           getInfo,
		"/version":                        GetCatchAll,
		"/images/json":                    GetCatchAll,
		"/images/viz":                     GetCatchAll,
		"/images/search":                  GetCatchAll,
		"/images/{name:.*}/get":           GetCatchAll,
		"/images/{name:.*}/history":       GetCatchAll,
		"/images/{name:.*}/json":          GetCatchAll,
		"/containers/ps":                  getContainersJSON,
		"/containers/json":                getContainersJSON,
		"/containers/{name:.*}/export":    GetCatchAll,
		"/containers/{name:.*}/changes":   GetCatchAll,
		"/containers/{name:.*}/json":      GetCatchAll,
		"/containers/{name:.*}/top":       GetCatchAll,
		"/containers/{name:.*}/logs":      GetCatchAll,
		"/containers/{name:.*}/attach/ws": GetCatchAll,
		"/ships/json":                     GetShipsJSON,
		"/plans/json":                     GetPlansJSON,
	},
	"POST": {
		"/auth":                         GetCatchAll,
		"/commit":                       GetCatchAll,
		"/build":                        GetCatchAll,
		"/images/create":                GetCatchAll,
		"/images/load":                  GetCatchAll,
		"/images/{name:.*}/push":        GetCatchAll,
		"/images/{name:.*}/tag":         GetCatchAll,
		"/containers/create":            PostContainersCreate,
		"/ships/create":                 PostShipsCreate,
		"/containers/{name:.*}/kill":    GetCatchAll,
		"/containers/{name:.*}/pause":   GetCatchAll,
		"/containers/{name:.*}/unpause": GetCatchAll,
		"/containers/{name:.*}/restart": GetCatchAll,
		"/containers/{name:.*}/start":   postContainersStart,
		"/containers/{name:.*}/stop":    postContainersStop,
		"/containers/{name:.*}/wait":    GetCatchAll,
		"/containers/{name:.*}/resize":  GetCatchAll,
		"/containers/{name:.*}/attach":  postContainersAttach,
		"/containers/{name:.*}/copy":    GetCatchAll,
	},
	"DELETE": {
		"/containers/{name:.*}": GetCatchAll,
		"/images/{name:.*}":     GetCatchAll,
		"/ships/{name:.*}":      DeleteShips,
	},
	"OPTIONS": {
		"": GetCatchAll,
	},
}

Functions

func AttachJobs

func AttachJobs(eng *engine.Engine) error

func AttachProfiler

func AttachProfiler(router *mux.Router)

func Call

func Call(method string, ship types.Ship, path string, data interface{}, passAuthInfo bool) ([]byte, int, error)

func ContainerAttach

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

func ContainerCreate

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

func ContainerDelete

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

func ContainerPause

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

func ContainerRestart

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

func ContainerStart

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

func ContainerStop

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

func ContainerUnpause

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

func Containers

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

func DeleteShips

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

func ErrConnectionRefused

func ErrConnectionRefused(host string) error

func GetCatchAll

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

func GetPlansJSON

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

func GetShipsJSON

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

func ListenAndServe

func ListenAndServe(proto, addr string, job *engine.Job) error

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

func PostContainersCreate

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

func PostShipsCreate

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

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.

Types

type HttpApiFunc

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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