api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2016 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerHTTPError

func DockerHTTPError(w http.ResponseWriter, err error)

DockerHTTPError returns a 200 status to docker with an error struct. It returns 500 if marshalling failed.

func RESTHTTPError

func RESTHTTPError(w http.ResponseWriter, err error)

RESTHTTPError returns a 500 status with the error.

Types

type API

type API struct {
	DockerPlugin bool
	Client       *config.Client
	Global       **config.Global // double pointer so we can track watch updates
}

API is a typed representation of API handlers.

func NewAPI

func NewAPI(client *config.Client, global **config.Global, dockerPlugin bool) *API

NewAPI returns an *API

func (*API) Create

func (a *API) Create(w http.ResponseWriter, r *http.Request)

Create fully creates a volume

func (*API) HTTPError

func (a *API) HTTPError(w http.ResponseWriter, err error)

HTTPError is a generic HTTP error function that works across the plugin and REST interfaces. It is intended to be used by handlers that exist in this package.

type Volume

type Volume struct {
	Name       string
	Mountpoint string
}

Volume represents the contiv 'Volume' entity used in get and list

type VolumeCreateRequest

type VolumeCreateRequest struct {
	Name string
	Opts map[string]string
}

VolumeCreateRequest is taken from struct Request in https://github.com/calavera/docker-volume-api/blob/master/api.go#L27

type VolumeCreateResponse

type VolumeCreateResponse struct {
	Mountpoint string
	Err        string
}

VolumeCreateResponse is taken from struct Response in https://github.com/calavera/docker-volume-api/blob/master/api.go#L33

type VolumeGetRequest

type VolumeGetRequest struct {
	Name string
}

VolumeGetRequest is taken from this struct in https://github.com/docker/docker/blob/master/volume/drivers/proxy.go#L187

type VolumeGetResponse

type VolumeGetResponse struct {
	Volume Volume
	Err    string
}

VolumeGetResponse is taken from struct volumeDriverProxyGetResponse in https://github.com/docker/docker/blob/master/volume/drivers/proxy.go#L191

type VolumeList

type VolumeList struct {
	Volumes []Volume
	Err     string
}

VolumeList is taken from struct volumeDriverProxyListResponse in https://github.com/docker/docker/blob/master/volume/drivers/proxy.go#L163

Jump to

Keyboard shortcuts

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