2015-06-10 09:46:54 -04:00
|
|
|
// generated code - DO NOT EDIT
|
|
|
|
|
2015-05-19 16:05:25 -04:00
|
|
|
package volumedrivers
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
import "errors"
|
2015-05-22 13:37:00 -04:00
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type client interface {
|
|
|
|
Call(string, interface{}, interface{}) error
|
|
|
|
}
|
2015-05-19 16:05:25 -04:00
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxy struct {
|
|
|
|
client
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyCreateRequest struct {
|
|
|
|
Name string
|
2015-06-12 09:25:32 -04:00
|
|
|
Opts opts
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyCreateResponse struct {
|
|
|
|
Err string
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-12 09:25:32 -04:00
|
|
|
func (pp *volumeDriverProxy) Create(name string, opts opts) (err error) {
|
2015-06-10 09:46:54 -04:00
|
|
|
var (
|
|
|
|
req volumeDriverProxyCreateRequest
|
|
|
|
ret volumeDriverProxyCreateResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
2015-06-12 09:25:32 -04:00
|
|
|
req.Opts = opts
|
2015-06-10 09:46:54 -04:00
|
|
|
if err = pp.Call("VolumeDriver.Create", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyRemoveRequest struct {
|
|
|
|
Name string
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyRemoveResponse struct {
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pp *volumeDriverProxy) Remove(name string) (err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyRemoveRequest
|
|
|
|
ret volumeDriverProxyRemoveResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
|
|
|
if err = pp.Call("VolumeDriver.Remove", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyPathRequest struct {
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyPathResponse struct {
|
|
|
|
Mountpoint string
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pp *volumeDriverProxy) Path(name string) (mountpoint string, err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyPathRequest
|
|
|
|
ret volumeDriverProxyPathResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
|
|
|
if err = pp.Call("VolumeDriver.Path", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
mountpoint = ret.Mountpoint
|
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyMountRequest struct {
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyMountResponse struct {
|
|
|
|
Mountpoint string
|
|
|
|
Err string
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
func (pp *volumeDriverProxy) Mount(name string) (mountpoint string, err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyMountRequest
|
|
|
|
ret volumeDriverProxyMountResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
|
|
|
if err = pp.Call("VolumeDriver.Mount", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-22 13:37:00 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
mountpoint = ret.Mountpoint
|
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyUnmountRequest struct {
|
|
|
|
Name string
|
2015-05-22 13:37:00 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyUnmountResponse struct {
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pp *volumeDriverProxy) Unmount(name string) (err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyUnmountRequest
|
|
|
|
ret volumeDriverProxyUnmountResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
|
|
|
if err = pp.Call("VolumeDriver.Unmount", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|