Documentation ¶
Index ¶
- func Activate(w http.ResponseWriter, r *http.Request)
- func Capabilities(w http.ResponseWriter, r *http.Request)
- func Deactivate(w http.ResponseWriter, r *http.Request)
- func NewVolplugin() api.Volplugin
- type Response
- type Volplugin
- func (v *Volplugin) HTTPError(w http.ResponseWriter, err error)
- func (v *Volplugin) ReadCreate(r *http.Request) (*config.VolumeRequest, error)
- func (v *Volplugin) ReadGet(r *http.Request) (string, error)
- func (v *Volplugin) ReadMount(r *http.Request) (*api.Volume, error)
- func (v *Volplugin) ReadPath(r *http.Request) (string, error)
- func (v *Volplugin) Router(a *api.API) *mux.Router
- func (v *Volplugin) WriteCreate(volConfig *config.Volume, w http.ResponseWriter) error
- func (v *Volplugin) WriteGet(name, mountpoint string, w http.ResponseWriter) error
- func (v *Volplugin) WriteList(volumes []string, w http.ResponseWriter) error
- func (v *Volplugin) WriteMount(mountPoint string, w http.ResponseWriter) error
- func (v *Volplugin) WritePath(mountpoint string, w http.ResponseWriter) error
- type Volume
- type VolumeCreateRequest
- type VolumeGetRequest
- type VolumeGetResponse
- type VolumeList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Activate ¶
func Activate(w http.ResponseWriter, r *http.Request)
Activate activates the plugin.
func Capabilities ¶
func Capabilities(w http.ResponseWriter, r *http.Request)
Capabilities is the API response for docker capabilities requests.
func Deactivate ¶
func Deactivate(w http.ResponseWriter, r *http.Request)
Deactivate deactivates the plugin.
func NewVolplugin ¶
NewVolplugin initializes the docker api interface for volplugin.
Types ¶
type Response ¶
Response is taken from struct Response in https://github.com/calavera/docker-volume-api/blob/master/api.go#L33
type Volplugin ¶
type Volplugin struct{}
Volplugin implements the docker volumes API via the interfaces in api/interfaces.go.
func (*Volplugin) HTTPError ¶
func (v *Volplugin) HTTPError(w http.ResponseWriter, err error)
HTTPError returns a 200 status to docker with an error struct. It returns 500 if marshalling failed.
func (*Volplugin) ReadCreate ¶
ReadCreate reads a create request from docker and parses it into a policy/volume.
func (*Volplugin) ReadGet ¶
ReadGet reads requests for the various Get endpoints (which all do the same thing)
func (*Volplugin) ReadMount ¶
ReadMount reads a mount request and returns the name of the volume to mount.
NOTE: this is the same for both path and mount and unmount. The docker implementation provides us with no other information.
func (*Volplugin) Router ¶
Router returns a docker-compatible HTTP gorilla/mux router. If the debug global is set, handlers will be wrapped in a request logger.
func (*Volplugin) WriteCreate ¶
WriteCreate writes the response to a create request back to docker.
func (*Volplugin) WriteGet ¶
func (v *Volplugin) WriteGet(name, mountpoint string, w http.ResponseWriter) error
WriteGet writes an appropriate response to Get calls.
func (*Volplugin) WriteList ¶
func (v *Volplugin) WriteList(volumes []string, w http.ResponseWriter) error
WriteList writes out a list of volume names to the requesting docker.
func (*Volplugin) WriteMount ¶
func (v *Volplugin) WriteMount(mountPoint string, w http.ResponseWriter) error
WriteMount writes the mountpoint as a reply to a mount request.
type VolumeCreateRequest ¶
VolumeCreateRequest is taken from struct Request in https://github.com/calavera/docker-volume-api/blob/master/api.go#L27
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 ¶
VolumeGetResponse is taken from struct volumeDriverProxyGetResponse in https://github.com/docker/docker/blob/master/volume/drivers/proxy.go#L191
type VolumeList ¶
VolumeList is taken from struct volumeDriverProxyListResponse in https://github.com/docker/docker/blob/master/volume/drivers/proxy.go#L163