Documentation ¶
Index ¶
- func Action(w http.ResponseWriter, r *http.Request)
- func LogHandler(name string, debug bool, actionFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func RESTHTTPError(w http.ResponseWriter, err error)
- type API
- func (a *API) AddStopChan(name string, stopChan chan struct{})
- func (a *API) Create(w http.ResponseWriter, r *http.Request)
- func (a *API) Get(w http.ResponseWriter, r *http.Request)
- func (a *API) GetStorageParameters(uc *Volume) (storage.MountDriver, *config.Volume, storage.DriverOptions, error)
- func (a *API) List(w http.ResponseWriter, r *http.Request)
- func (a *API) Mount(w http.ResponseWriter, r *http.Request)
- func (a *API) Path(w http.ResponseWriter, r *http.Request)
- func (a *API) RemoveStopChan(name string)
- func (a *API) Unmount(w http.ResponseWriter, r *http.Request)
- type HTTP
- type Volplugin
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Action ¶ added in v0.3.0
func Action(w http.ResponseWriter, r *http.Request)
Action is a catchall for additional driver functions.
func LogHandler ¶ added in v0.3.0
func LogHandler(name string, debug bool, actionFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
LogHandler injects a request logging handler if debugging is active. In either event it will dispatch.
func RESTHTTPError ¶
func RESTHTTPError(w http.ResponseWriter, err error)
RESTHTTPError returns a 500 status with the error.
Types ¶
type API ¶
type API struct { Volplugin Hostname string Client *config.Client Global **config.Global // double pointer so we can track watch updates Lock *lock.Driver MountCounter *mount.Counter MountCollection *mount.Collection // contains filtered or unexported fields }
API is a typed representation of API handlers.
func NewAPI ¶
func NewAPI(volplugin Volplugin, hostname string, client *config.Client, global **config.Global) *API
NewAPI returns an *API
func (*API) AddStopChan ¶ added in v0.3.0
AddStopChan adds a stop channel for the purposes of controlling mount ttl refresh goroutines
func (*API) Create ¶
func (a *API) Create(w http.ResponseWriter, r *http.Request)
Create fully creates a volume
func (*API) Get ¶ added in v0.3.0
func (a *API) Get(w http.ResponseWriter, r *http.Request)
Get is the request to obtain information about a volume.
func (*API) GetStorageParameters ¶ added in v0.3.0
func (a *API) GetStorageParameters(uc *Volume) (storage.MountDriver, *config.Volume, storage.DriverOptions, error)
GetStorageParameters accepts a Volume API request and turns it into several internal structs.
func (*API) List ¶ added in v0.3.0
func (a *API) List(w http.ResponseWriter, r *http.Request)
List is the request to obtain a list of the volumes.
func (*API) Mount ¶ added in v0.3.0
func (a *API) Mount(w http.ResponseWriter, r *http.Request)
Mount is the request to mount a volume.
func (*API) Path ¶ added in v0.3.0
func (a *API) Path(w http.ResponseWriter, r *http.Request)
Path is the handler for both Path and Remove requests. We do not honor remove requests; they can be done with volcli.
func (*API) RemoveStopChan ¶ added in v0.3.0
RemoveStopChan removes a stop channel for the purposes of controlling mount ttl refresh goroutines
type HTTP ¶ added in v0.3.0
type HTTP interface { Router(*API) *mux.Router HTTPError(http.ResponseWriter, error) // note that it is expected that anything that calls this returns immediately afterwards. }
HTTP is a generic interface to HTTP calls. Used by the other interfaces.
type Volplugin ¶ added in v0.3.0
type Volplugin interface { HTTP ReadCreate(*http.Request) (*config.VolumeRequest, error) WriteCreate(*config.Volume, http.ResponseWriter) error ReadGet(*http.Request) (string, error) WriteGet(string, string, http.ResponseWriter) error ReadPath(*http.Request) (string, error) WritePath(string, http.ResponseWriter) error WriteList([]string, http.ResponseWriter) error ReadMount(*http.Request) (*Volume, error) WriteMount(string, http.ResponseWriter) error }
Volplugin is the interface that volplugin needs to provide to the clients (docker/k8s/mesos).