github.com/slava-ustovytski/docker@v1.8.2-rc1/volume/drivers/proxy.go (about) 1 // generated code - DO NOT EDIT 2 3 package volumedrivers 4 5 import "errors" 6 7 type client interface { 8 Call(string, interface{}, interface{}) error 9 } 10 11 type volumeDriverProxy struct { 12 client 13 } 14 15 type volumeDriverProxyCreateRequest struct { 16 Name string 17 } 18 19 type volumeDriverProxyCreateResponse struct { 20 Err string 21 } 22 23 func (pp *volumeDriverProxy) Create(name string) (err error) { 24 var ( 25 req volumeDriverProxyCreateRequest 26 ret volumeDriverProxyCreateResponse 27 ) 28 29 req.Name = name 30 if err = pp.Call("VolumeDriver.Create", req, &ret); err != nil { 31 return 32 } 33 34 if ret.Err != "" { 35 err = errors.New(ret.Err) 36 } 37 38 return 39 } 40 41 type volumeDriverProxyRemoveRequest struct { 42 Name string 43 } 44 45 type volumeDriverProxyRemoveResponse struct { 46 Err string 47 } 48 49 func (pp *volumeDriverProxy) Remove(name string) (err error) { 50 var ( 51 req volumeDriverProxyRemoveRequest 52 ret volumeDriverProxyRemoveResponse 53 ) 54 55 req.Name = name 56 if err = pp.Call("VolumeDriver.Remove", req, &ret); err != nil { 57 return 58 } 59 60 if ret.Err != "" { 61 err = errors.New(ret.Err) 62 } 63 64 return 65 } 66 67 type volumeDriverProxyPathRequest struct { 68 Name string 69 } 70 71 type volumeDriverProxyPathResponse struct { 72 Mountpoint string 73 Err string 74 } 75 76 func (pp *volumeDriverProxy) Path(name string) (mountpoint string, err error) { 77 var ( 78 req volumeDriverProxyPathRequest 79 ret volumeDriverProxyPathResponse 80 ) 81 82 req.Name = name 83 if err = pp.Call("VolumeDriver.Path", req, &ret); err != nil { 84 return 85 } 86 87 mountpoint = ret.Mountpoint 88 89 if ret.Err != "" { 90 err = errors.New(ret.Err) 91 } 92 93 return 94 } 95 96 type volumeDriverProxyMountRequest struct { 97 Name string 98 } 99 100 type volumeDriverProxyMountResponse struct { 101 Mountpoint string 102 Err string 103 } 104 105 func (pp *volumeDriverProxy) Mount(name string) (mountpoint string, err error) { 106 var ( 107 req volumeDriverProxyMountRequest 108 ret volumeDriverProxyMountResponse 109 ) 110 111 req.Name = name 112 if err = pp.Call("VolumeDriver.Mount", req, &ret); err != nil { 113 return 114 } 115 116 mountpoint = ret.Mountpoint 117 118 if ret.Err != "" { 119 err = errors.New(ret.Err) 120 } 121 122 return 123 } 124 125 type volumeDriverProxyUnmountRequest struct { 126 Name string 127 } 128 129 type volumeDriverProxyUnmountResponse struct { 130 Err string 131 } 132 133 func (pp *volumeDriverProxy) Unmount(name string) (err error) { 134 var ( 135 req volumeDriverProxyUnmountRequest 136 ret volumeDriverProxyUnmountResponse 137 ) 138 139 req.Name = name 140 if err = pp.Call("VolumeDriver.Unmount", req, &ret); err != nil { 141 return 142 } 143 144 if ret.Err != "" { 145 err = errors.New(ret.Err) 146 } 147 148 return 149 }