api.pb.go 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  14. // source: api.proto
  15. /*
  16. Package deviceplugin is a generated protocol buffer package.
  17. It is generated from these files:
  18. api.proto
  19. It has these top-level messages:
  20. RegisterRequest
  21. Empty
  22. ListAndWatchResponse
  23. Device
  24. AllocateRequest
  25. AllocateResponse
  26. Mount
  27. DeviceSpec
  28. */
  29. package deviceplugin
  30. import proto "github.com/gogo/protobuf/proto"
  31. import fmt "fmt"
  32. import math "math"
  33. import _ "github.com/gogo/protobuf/gogoproto"
  34. import (
  35. context "golang.org/x/net/context"
  36. grpc "google.golang.org/grpc"
  37. )
  38. import strings "strings"
  39. import reflect "reflect"
  40. import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
  41. import io "io"
  42. // Reference imports to suppress errors if they are not otherwise used.
  43. var _ = proto.Marshal
  44. var _ = fmt.Errorf
  45. var _ = math.Inf
  46. // This is a compile-time assertion to ensure that this generated file
  47. // is compatible with the proto package it is being compiled against.
  48. // A compilation error at this line likely means your copy of the
  49. // proto package needs to be updated.
  50. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  51. type RegisterRequest struct {
  52. // Version of the API the Device Plugin was built against
  53. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
  54. // Name of the unix socket the device plugin is listening on
  55. // PATH = path.Join(DevicePluginPath, endpoint)
  56. Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
  57. // Schedulable resource name. As of now it's expected to be a DNS Label
  58. ResourceName string `protobuf:"bytes,3,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
  59. }
  60. func (m *RegisterRequest) Reset() { *m = RegisterRequest{} }
  61. func (*RegisterRequest) ProtoMessage() {}
  62. func (*RegisterRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{0} }
  63. func (m *RegisterRequest) GetVersion() string {
  64. if m != nil {
  65. return m.Version
  66. }
  67. return ""
  68. }
  69. func (m *RegisterRequest) GetEndpoint() string {
  70. if m != nil {
  71. return m.Endpoint
  72. }
  73. return ""
  74. }
  75. func (m *RegisterRequest) GetResourceName() string {
  76. if m != nil {
  77. return m.ResourceName
  78. }
  79. return ""
  80. }
  81. type Empty struct {
  82. }
  83. func (m *Empty) Reset() { *m = Empty{} }
  84. func (*Empty) ProtoMessage() {}
  85. func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{1} }
  86. // ListAndWatch returns a stream of List of Devices
  87. // Whenever a Device state changes or a Device disappears, ListAndWatch
  88. // returns the new list
  89. type ListAndWatchResponse struct {
  90. Devices []*Device `protobuf:"bytes,1,rep,name=devices" json:"devices,omitempty"`
  91. }
  92. func (m *ListAndWatchResponse) Reset() { *m = ListAndWatchResponse{} }
  93. func (*ListAndWatchResponse) ProtoMessage() {}
  94. func (*ListAndWatchResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{2} }
  95. func (m *ListAndWatchResponse) GetDevices() []*Device {
  96. if m != nil {
  97. return m.Devices
  98. }
  99. return nil
  100. }
  101. // E.g:
  102. // struct Device {
  103. // ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e",
  104. // State: "Healthy",
  105. // }
  106. type Device struct {
  107. // A unique ID assigned by the device plugin used
  108. // to identify devices during the communication
  109. // Max length of this field is 63 characters
  110. ID string `protobuf:"bytes,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
  111. // Health of the device, can be healthy or unhealthy, see constants.go
  112. Health string `protobuf:"bytes,2,opt,name=health,proto3" json:"health,omitempty"`
  113. }
  114. func (m *Device) Reset() { *m = Device{} }
  115. func (*Device) ProtoMessage() {}
  116. func (*Device) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{3} }
  117. func (m *Device) GetID() string {
  118. if m != nil {
  119. return m.ID
  120. }
  121. return ""
  122. }
  123. func (m *Device) GetHealth() string {
  124. if m != nil {
  125. return m.Health
  126. }
  127. return ""
  128. }
  129. // - Allocate is expected to be called during pod creation since allocation
  130. // failures for any container would result in pod startup failure.
  131. // - Allocate allows kubelet to exposes additional artifacts in a pod's
  132. // environment as directed by the plugin.
  133. // - Allocate allows Device Plugin to run device specific operations on
  134. // the Devices requested
  135. type AllocateRequest struct {
  136. DevicesIDs []string `protobuf:"bytes,1,rep,name=devicesIDs" json:"devicesIDs,omitempty"`
  137. }
  138. func (m *AllocateRequest) Reset() { *m = AllocateRequest{} }
  139. func (*AllocateRequest) ProtoMessage() {}
  140. func (*AllocateRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{4} }
  141. func (m *AllocateRequest) GetDevicesIDs() []string {
  142. if m != nil {
  143. return m.DevicesIDs
  144. }
  145. return nil
  146. }
  147. // AllocateResponse includes the artifacts that needs to be injected into
  148. // a container for accessing 'deviceIDs' that were mentioned as part of
  149. // 'AllocateRequest'.
  150. // Failure Handling:
  151. // if Kubelet sends an allocation request for dev1 and dev2.
  152. // Allocation on dev1 succeeds but allocation on dev2 fails.
  153. // The Device plugin should send a ListAndWatch update and fail the
  154. // Allocation request
  155. type AllocateResponse struct {
  156. // List of environment variable to be set in the container to access one of more devices.
  157. Envs map[string]string `protobuf:"bytes,1,rep,name=envs" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  158. // Mounts for the container.
  159. Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts" json:"mounts,omitempty"`
  160. // Devices for the container.
  161. Devices []*DeviceSpec `protobuf:"bytes,3,rep,name=devices" json:"devices,omitempty"`
  162. // Container annotations to pass to the container runtime
  163. Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  164. }
  165. func (m *AllocateResponse) Reset() { *m = AllocateResponse{} }
  166. func (*AllocateResponse) ProtoMessage() {}
  167. func (*AllocateResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{5} }
  168. func (m *AllocateResponse) GetEnvs() map[string]string {
  169. if m != nil {
  170. return m.Envs
  171. }
  172. return nil
  173. }
  174. func (m *AllocateResponse) GetMounts() []*Mount {
  175. if m != nil {
  176. return m.Mounts
  177. }
  178. return nil
  179. }
  180. func (m *AllocateResponse) GetDevices() []*DeviceSpec {
  181. if m != nil {
  182. return m.Devices
  183. }
  184. return nil
  185. }
  186. func (m *AllocateResponse) GetAnnotations() map[string]string {
  187. if m != nil {
  188. return m.Annotations
  189. }
  190. return nil
  191. }
  192. // Mount specifies a host volume to mount into a container.
  193. // where device library or tools are installed on host and container
  194. type Mount struct {
  195. // Path of the mount within the container.
  196. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"`
  197. // Path of the mount on the host.
  198. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
  199. // If set, the mount is read-only.
  200. ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
  201. }
  202. func (m *Mount) Reset() { *m = Mount{} }
  203. func (*Mount) ProtoMessage() {}
  204. func (*Mount) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{6} }
  205. func (m *Mount) GetContainerPath() string {
  206. if m != nil {
  207. return m.ContainerPath
  208. }
  209. return ""
  210. }
  211. func (m *Mount) GetHostPath() string {
  212. if m != nil {
  213. return m.HostPath
  214. }
  215. return ""
  216. }
  217. func (m *Mount) GetReadOnly() bool {
  218. if m != nil {
  219. return m.ReadOnly
  220. }
  221. return false
  222. }
  223. // DeviceSpec specifies a host device to mount into a container.
  224. type DeviceSpec struct {
  225. // Path of the device within the container.
  226. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"`
  227. // Path of the device on the host.
  228. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
  229. // Cgroups permissions of the device, candidates are one or more of
  230. // * r - allows container to read from the specified device.
  231. // * w - allows container to write to the specified device.
  232. // * m - allows container to create device files that do not yet exist.
  233. Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"`
  234. }
  235. func (m *DeviceSpec) Reset() { *m = DeviceSpec{} }
  236. func (*DeviceSpec) ProtoMessage() {}
  237. func (*DeviceSpec) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{7} }
  238. func (m *DeviceSpec) GetContainerPath() string {
  239. if m != nil {
  240. return m.ContainerPath
  241. }
  242. return ""
  243. }
  244. func (m *DeviceSpec) GetHostPath() string {
  245. if m != nil {
  246. return m.HostPath
  247. }
  248. return ""
  249. }
  250. func (m *DeviceSpec) GetPermissions() string {
  251. if m != nil {
  252. return m.Permissions
  253. }
  254. return ""
  255. }
  256. func init() {
  257. proto.RegisterType((*RegisterRequest)(nil), "deviceplugin.RegisterRequest")
  258. proto.RegisterType((*Empty)(nil), "deviceplugin.Empty")
  259. proto.RegisterType((*ListAndWatchResponse)(nil), "deviceplugin.ListAndWatchResponse")
  260. proto.RegisterType((*Device)(nil), "deviceplugin.Device")
  261. proto.RegisterType((*AllocateRequest)(nil), "deviceplugin.AllocateRequest")
  262. proto.RegisterType((*AllocateResponse)(nil), "deviceplugin.AllocateResponse")
  263. proto.RegisterType((*Mount)(nil), "deviceplugin.Mount")
  264. proto.RegisterType((*DeviceSpec)(nil), "deviceplugin.DeviceSpec")
  265. }
  266. // Reference imports to suppress errors if they are not otherwise used.
  267. var _ context.Context
  268. var _ grpc.ClientConn
  269. // This is a compile-time assertion to ensure that this generated file
  270. // is compatible with the grpc package it is being compiled against.
  271. const _ = grpc.SupportPackageIsVersion4
  272. // Client API for Registration service
  273. type RegistrationClient interface {
  274. Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error)
  275. }
  276. type registrationClient struct {
  277. cc *grpc.ClientConn
  278. }
  279. func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient {
  280. return &registrationClient{cc}
  281. }
  282. func (c *registrationClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error) {
  283. out := new(Empty)
  284. err := grpc.Invoke(ctx, "/deviceplugin.Registration/Register", in, out, c.cc, opts...)
  285. if err != nil {
  286. return nil, err
  287. }
  288. return out, nil
  289. }
  290. // Server API for Registration service
  291. type RegistrationServer interface {
  292. Register(context.Context, *RegisterRequest) (*Empty, error)
  293. }
  294. func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer) {
  295. s.RegisterService(&_Registration_serviceDesc, srv)
  296. }
  297. func _Registration_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  298. in := new(RegisterRequest)
  299. if err := dec(in); err != nil {
  300. return nil, err
  301. }
  302. if interceptor == nil {
  303. return srv.(RegistrationServer).Register(ctx, in)
  304. }
  305. info := &grpc.UnaryServerInfo{
  306. Server: srv,
  307. FullMethod: "/deviceplugin.Registration/Register",
  308. }
  309. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  310. return srv.(RegistrationServer).Register(ctx, req.(*RegisterRequest))
  311. }
  312. return interceptor(ctx, in, info, handler)
  313. }
  314. var _Registration_serviceDesc = grpc.ServiceDesc{
  315. ServiceName: "deviceplugin.Registration",
  316. HandlerType: (*RegistrationServer)(nil),
  317. Methods: []grpc.MethodDesc{
  318. {
  319. MethodName: "Register",
  320. Handler: _Registration_Register_Handler,
  321. },
  322. },
  323. Streams: []grpc.StreamDesc{},
  324. Metadata: "api.proto",
  325. }
  326. // Client API for DevicePlugin service
  327. type DevicePluginClient interface {
  328. // ListAndWatch returns a stream of List of Devices
  329. // Whenever a Device state changes or a Device disappears, ListAndWatch
  330. // returns the new list
  331. ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DevicePlugin_ListAndWatchClient, error)
  332. // Allocate is called during container creation so that the Device
  333. // Plugin can run device specific operations and instruct Kubelet
  334. // of the steps to make the Device available in the container
  335. Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
  336. }
  337. type devicePluginClient struct {
  338. cc *grpc.ClientConn
  339. }
  340. func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient {
  341. return &devicePluginClient{cc}
  342. }
  343. func (c *devicePluginClient) ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DevicePlugin_ListAndWatchClient, error) {
  344. stream, err := grpc.NewClientStream(ctx, &_DevicePlugin_serviceDesc.Streams[0], c.cc, "/deviceplugin.DevicePlugin/ListAndWatch", opts...)
  345. if err != nil {
  346. return nil, err
  347. }
  348. x := &devicePluginListAndWatchClient{stream}
  349. if err := x.ClientStream.SendMsg(in); err != nil {
  350. return nil, err
  351. }
  352. if err := x.ClientStream.CloseSend(); err != nil {
  353. return nil, err
  354. }
  355. return x, nil
  356. }
  357. type DevicePlugin_ListAndWatchClient interface {
  358. Recv() (*ListAndWatchResponse, error)
  359. grpc.ClientStream
  360. }
  361. type devicePluginListAndWatchClient struct {
  362. grpc.ClientStream
  363. }
  364. func (x *devicePluginListAndWatchClient) Recv() (*ListAndWatchResponse, error) {
  365. m := new(ListAndWatchResponse)
  366. if err := x.ClientStream.RecvMsg(m); err != nil {
  367. return nil, err
  368. }
  369. return m, nil
  370. }
  371. func (c *devicePluginClient) Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error) {
  372. out := new(AllocateResponse)
  373. err := grpc.Invoke(ctx, "/deviceplugin.DevicePlugin/Allocate", in, out, c.cc, opts...)
  374. if err != nil {
  375. return nil, err
  376. }
  377. return out, nil
  378. }
  379. // Server API for DevicePlugin service
  380. type DevicePluginServer interface {
  381. // ListAndWatch returns a stream of List of Devices
  382. // Whenever a Device state changes or a Device disappears, ListAndWatch
  383. // returns the new list
  384. ListAndWatch(*Empty, DevicePlugin_ListAndWatchServer) error
  385. // Allocate is called during container creation so that the Device
  386. // Plugin can run device specific operations and instruct Kubelet
  387. // of the steps to make the Device available in the container
  388. Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
  389. }
  390. func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer) {
  391. s.RegisterService(&_DevicePlugin_serviceDesc, srv)
  392. }
  393. func _DevicePlugin_ListAndWatch_Handler(srv interface{}, stream grpc.ServerStream) error {
  394. m := new(Empty)
  395. if err := stream.RecvMsg(m); err != nil {
  396. return err
  397. }
  398. return srv.(DevicePluginServer).ListAndWatch(m, &devicePluginListAndWatchServer{stream})
  399. }
  400. type DevicePlugin_ListAndWatchServer interface {
  401. Send(*ListAndWatchResponse) error
  402. grpc.ServerStream
  403. }
  404. type devicePluginListAndWatchServer struct {
  405. grpc.ServerStream
  406. }
  407. func (x *devicePluginListAndWatchServer) Send(m *ListAndWatchResponse) error {
  408. return x.ServerStream.SendMsg(m)
  409. }
  410. func _DevicePlugin_Allocate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  411. in := new(AllocateRequest)
  412. if err := dec(in); err != nil {
  413. return nil, err
  414. }
  415. if interceptor == nil {
  416. return srv.(DevicePluginServer).Allocate(ctx, in)
  417. }
  418. info := &grpc.UnaryServerInfo{
  419. Server: srv,
  420. FullMethod: "/deviceplugin.DevicePlugin/Allocate",
  421. }
  422. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  423. return srv.(DevicePluginServer).Allocate(ctx, req.(*AllocateRequest))
  424. }
  425. return interceptor(ctx, in, info, handler)
  426. }
  427. var _DevicePlugin_serviceDesc = grpc.ServiceDesc{
  428. ServiceName: "deviceplugin.DevicePlugin",
  429. HandlerType: (*DevicePluginServer)(nil),
  430. Methods: []grpc.MethodDesc{
  431. {
  432. MethodName: "Allocate",
  433. Handler: _DevicePlugin_Allocate_Handler,
  434. },
  435. },
  436. Streams: []grpc.StreamDesc{
  437. {
  438. StreamName: "ListAndWatch",
  439. Handler: _DevicePlugin_ListAndWatch_Handler,
  440. ServerStreams: true,
  441. },
  442. },
  443. Metadata: "api.proto",
  444. }
  445. func (m *RegisterRequest) Marshal() (dAtA []byte, err error) {
  446. size := m.Size()
  447. dAtA = make([]byte, size)
  448. n, err := m.MarshalTo(dAtA)
  449. if err != nil {
  450. return nil, err
  451. }
  452. return dAtA[:n], nil
  453. }
  454. func (m *RegisterRequest) MarshalTo(dAtA []byte) (int, error) {
  455. var i int
  456. _ = i
  457. var l int
  458. _ = l
  459. if len(m.Version) > 0 {
  460. dAtA[i] = 0xa
  461. i++
  462. i = encodeVarintApi(dAtA, i, uint64(len(m.Version)))
  463. i += copy(dAtA[i:], m.Version)
  464. }
  465. if len(m.Endpoint) > 0 {
  466. dAtA[i] = 0x12
  467. i++
  468. i = encodeVarintApi(dAtA, i, uint64(len(m.Endpoint)))
  469. i += copy(dAtA[i:], m.Endpoint)
  470. }
  471. if len(m.ResourceName) > 0 {
  472. dAtA[i] = 0x1a
  473. i++
  474. i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceName)))
  475. i += copy(dAtA[i:], m.ResourceName)
  476. }
  477. return i, nil
  478. }
  479. func (m *Empty) Marshal() (dAtA []byte, err error) {
  480. size := m.Size()
  481. dAtA = make([]byte, size)
  482. n, err := m.MarshalTo(dAtA)
  483. if err != nil {
  484. return nil, err
  485. }
  486. return dAtA[:n], nil
  487. }
  488. func (m *Empty) MarshalTo(dAtA []byte) (int, error) {
  489. var i int
  490. _ = i
  491. var l int
  492. _ = l
  493. return i, nil
  494. }
  495. func (m *ListAndWatchResponse) Marshal() (dAtA []byte, err error) {
  496. size := m.Size()
  497. dAtA = make([]byte, size)
  498. n, err := m.MarshalTo(dAtA)
  499. if err != nil {
  500. return nil, err
  501. }
  502. return dAtA[:n], nil
  503. }
  504. func (m *ListAndWatchResponse) MarshalTo(dAtA []byte) (int, error) {
  505. var i int
  506. _ = i
  507. var l int
  508. _ = l
  509. if len(m.Devices) > 0 {
  510. for _, msg := range m.Devices {
  511. dAtA[i] = 0xa
  512. i++
  513. i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
  514. n, err := msg.MarshalTo(dAtA[i:])
  515. if err != nil {
  516. return 0, err
  517. }
  518. i += n
  519. }
  520. }
  521. return i, nil
  522. }
  523. func (m *Device) Marshal() (dAtA []byte, err error) {
  524. size := m.Size()
  525. dAtA = make([]byte, size)
  526. n, err := m.MarshalTo(dAtA)
  527. if err != nil {
  528. return nil, err
  529. }
  530. return dAtA[:n], nil
  531. }
  532. func (m *Device) MarshalTo(dAtA []byte) (int, error) {
  533. var i int
  534. _ = i
  535. var l int
  536. _ = l
  537. if len(m.ID) > 0 {
  538. dAtA[i] = 0xa
  539. i++
  540. i = encodeVarintApi(dAtA, i, uint64(len(m.ID)))
  541. i += copy(dAtA[i:], m.ID)
  542. }
  543. if len(m.Health) > 0 {
  544. dAtA[i] = 0x12
  545. i++
  546. i = encodeVarintApi(dAtA, i, uint64(len(m.Health)))
  547. i += copy(dAtA[i:], m.Health)
  548. }
  549. return i, nil
  550. }
  551. func (m *AllocateRequest) Marshal() (dAtA []byte, err error) {
  552. size := m.Size()
  553. dAtA = make([]byte, size)
  554. n, err := m.MarshalTo(dAtA)
  555. if err != nil {
  556. return nil, err
  557. }
  558. return dAtA[:n], nil
  559. }
  560. func (m *AllocateRequest) MarshalTo(dAtA []byte) (int, error) {
  561. var i int
  562. _ = i
  563. var l int
  564. _ = l
  565. if len(m.DevicesIDs) > 0 {
  566. for _, s := range m.DevicesIDs {
  567. dAtA[i] = 0xa
  568. i++
  569. l = len(s)
  570. for l >= 1<<7 {
  571. dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
  572. l >>= 7
  573. i++
  574. }
  575. dAtA[i] = uint8(l)
  576. i++
  577. i += copy(dAtA[i:], s)
  578. }
  579. }
  580. return i, nil
  581. }
  582. func (m *AllocateResponse) Marshal() (dAtA []byte, err error) {
  583. size := m.Size()
  584. dAtA = make([]byte, size)
  585. n, err := m.MarshalTo(dAtA)
  586. if err != nil {
  587. return nil, err
  588. }
  589. return dAtA[:n], nil
  590. }
  591. func (m *AllocateResponse) MarshalTo(dAtA []byte) (int, error) {
  592. var i int
  593. _ = i
  594. var l int
  595. _ = l
  596. if len(m.Envs) > 0 {
  597. for k := range m.Envs {
  598. dAtA[i] = 0xa
  599. i++
  600. v := m.Envs[k]
  601. mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v)))
  602. i = encodeVarintApi(dAtA, i, uint64(mapSize))
  603. dAtA[i] = 0xa
  604. i++
  605. i = encodeVarintApi(dAtA, i, uint64(len(k)))
  606. i += copy(dAtA[i:], k)
  607. dAtA[i] = 0x12
  608. i++
  609. i = encodeVarintApi(dAtA, i, uint64(len(v)))
  610. i += copy(dAtA[i:], v)
  611. }
  612. }
  613. if len(m.Mounts) > 0 {
  614. for _, msg := range m.Mounts {
  615. dAtA[i] = 0x12
  616. i++
  617. i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
  618. n, err := msg.MarshalTo(dAtA[i:])
  619. if err != nil {
  620. return 0, err
  621. }
  622. i += n
  623. }
  624. }
  625. if len(m.Devices) > 0 {
  626. for _, msg := range m.Devices {
  627. dAtA[i] = 0x1a
  628. i++
  629. i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
  630. n, err := msg.MarshalTo(dAtA[i:])
  631. if err != nil {
  632. return 0, err
  633. }
  634. i += n
  635. }
  636. }
  637. if len(m.Annotations) > 0 {
  638. for k := range m.Annotations {
  639. dAtA[i] = 0x22
  640. i++
  641. v := m.Annotations[k]
  642. mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v)))
  643. i = encodeVarintApi(dAtA, i, uint64(mapSize))
  644. dAtA[i] = 0xa
  645. i++
  646. i = encodeVarintApi(dAtA, i, uint64(len(k)))
  647. i += copy(dAtA[i:], k)
  648. dAtA[i] = 0x12
  649. i++
  650. i = encodeVarintApi(dAtA, i, uint64(len(v)))
  651. i += copy(dAtA[i:], v)
  652. }
  653. }
  654. return i, nil
  655. }
  656. func (m *Mount) Marshal() (dAtA []byte, err error) {
  657. size := m.Size()
  658. dAtA = make([]byte, size)
  659. n, err := m.MarshalTo(dAtA)
  660. if err != nil {
  661. return nil, err
  662. }
  663. return dAtA[:n], nil
  664. }
  665. func (m *Mount) MarshalTo(dAtA []byte) (int, error) {
  666. var i int
  667. _ = i
  668. var l int
  669. _ = l
  670. if len(m.ContainerPath) > 0 {
  671. dAtA[i] = 0xa
  672. i++
  673. i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath)))
  674. i += copy(dAtA[i:], m.ContainerPath)
  675. }
  676. if len(m.HostPath) > 0 {
  677. dAtA[i] = 0x12
  678. i++
  679. i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath)))
  680. i += copy(dAtA[i:], m.HostPath)
  681. }
  682. if m.ReadOnly {
  683. dAtA[i] = 0x18
  684. i++
  685. if m.ReadOnly {
  686. dAtA[i] = 1
  687. } else {
  688. dAtA[i] = 0
  689. }
  690. i++
  691. }
  692. return i, nil
  693. }
  694. func (m *DeviceSpec) Marshal() (dAtA []byte, err error) {
  695. size := m.Size()
  696. dAtA = make([]byte, size)
  697. n, err := m.MarshalTo(dAtA)
  698. if err != nil {
  699. return nil, err
  700. }
  701. return dAtA[:n], nil
  702. }
  703. func (m *DeviceSpec) MarshalTo(dAtA []byte) (int, error) {
  704. var i int
  705. _ = i
  706. var l int
  707. _ = l
  708. if len(m.ContainerPath) > 0 {
  709. dAtA[i] = 0xa
  710. i++
  711. i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath)))
  712. i += copy(dAtA[i:], m.ContainerPath)
  713. }
  714. if len(m.HostPath) > 0 {
  715. dAtA[i] = 0x12
  716. i++
  717. i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath)))
  718. i += copy(dAtA[i:], m.HostPath)
  719. }
  720. if len(m.Permissions) > 0 {
  721. dAtA[i] = 0x1a
  722. i++
  723. i = encodeVarintApi(dAtA, i, uint64(len(m.Permissions)))
  724. i += copy(dAtA[i:], m.Permissions)
  725. }
  726. return i, nil
  727. }
  728. func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
  729. for v >= 1<<7 {
  730. dAtA[offset] = uint8(v&0x7f | 0x80)
  731. v >>= 7
  732. offset++
  733. }
  734. dAtA[offset] = uint8(v)
  735. return offset + 1
  736. }
  737. func (m *RegisterRequest) Size() (n int) {
  738. var l int
  739. _ = l
  740. l = len(m.Version)
  741. if l > 0 {
  742. n += 1 + l + sovApi(uint64(l))
  743. }
  744. l = len(m.Endpoint)
  745. if l > 0 {
  746. n += 1 + l + sovApi(uint64(l))
  747. }
  748. l = len(m.ResourceName)
  749. if l > 0 {
  750. n += 1 + l + sovApi(uint64(l))
  751. }
  752. return n
  753. }
  754. func (m *Empty) Size() (n int) {
  755. var l int
  756. _ = l
  757. return n
  758. }
  759. func (m *ListAndWatchResponse) Size() (n int) {
  760. var l int
  761. _ = l
  762. if len(m.Devices) > 0 {
  763. for _, e := range m.Devices {
  764. l = e.Size()
  765. n += 1 + l + sovApi(uint64(l))
  766. }
  767. }
  768. return n
  769. }
  770. func (m *Device) Size() (n int) {
  771. var l int
  772. _ = l
  773. l = len(m.ID)
  774. if l > 0 {
  775. n += 1 + l + sovApi(uint64(l))
  776. }
  777. l = len(m.Health)
  778. if l > 0 {
  779. n += 1 + l + sovApi(uint64(l))
  780. }
  781. return n
  782. }
  783. func (m *AllocateRequest) Size() (n int) {
  784. var l int
  785. _ = l
  786. if len(m.DevicesIDs) > 0 {
  787. for _, s := range m.DevicesIDs {
  788. l = len(s)
  789. n += 1 + l + sovApi(uint64(l))
  790. }
  791. }
  792. return n
  793. }
  794. func (m *AllocateResponse) Size() (n int) {
  795. var l int
  796. _ = l
  797. if len(m.Envs) > 0 {
  798. for k, v := range m.Envs {
  799. _ = k
  800. _ = v
  801. mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v)))
  802. n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize))
  803. }
  804. }
  805. if len(m.Mounts) > 0 {
  806. for _, e := range m.Mounts {
  807. l = e.Size()
  808. n += 1 + l + sovApi(uint64(l))
  809. }
  810. }
  811. if len(m.Devices) > 0 {
  812. for _, e := range m.Devices {
  813. l = e.Size()
  814. n += 1 + l + sovApi(uint64(l))
  815. }
  816. }
  817. if len(m.Annotations) > 0 {
  818. for k, v := range m.Annotations {
  819. _ = k
  820. _ = v
  821. mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v)))
  822. n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize))
  823. }
  824. }
  825. return n
  826. }
  827. func (m *Mount) Size() (n int) {
  828. var l int
  829. _ = l
  830. l = len(m.ContainerPath)
  831. if l > 0 {
  832. n += 1 + l + sovApi(uint64(l))
  833. }
  834. l = len(m.HostPath)
  835. if l > 0 {
  836. n += 1 + l + sovApi(uint64(l))
  837. }
  838. if m.ReadOnly {
  839. n += 2
  840. }
  841. return n
  842. }
  843. func (m *DeviceSpec) Size() (n int) {
  844. var l int
  845. _ = l
  846. l = len(m.ContainerPath)
  847. if l > 0 {
  848. n += 1 + l + sovApi(uint64(l))
  849. }
  850. l = len(m.HostPath)
  851. if l > 0 {
  852. n += 1 + l + sovApi(uint64(l))
  853. }
  854. l = len(m.Permissions)
  855. if l > 0 {
  856. n += 1 + l + sovApi(uint64(l))
  857. }
  858. return n
  859. }
  860. func sovApi(x uint64) (n int) {
  861. for {
  862. n++
  863. x >>= 7
  864. if x == 0 {
  865. break
  866. }
  867. }
  868. return n
  869. }
  870. func sozApi(x uint64) (n int) {
  871. return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  872. }
  873. func (this *RegisterRequest) String() string {
  874. if this == nil {
  875. return "nil"
  876. }
  877. s := strings.Join([]string{`&RegisterRequest{`,
  878. `Version:` + fmt.Sprintf("%v", this.Version) + `,`,
  879. `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`,
  880. `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`,
  881. `}`,
  882. }, "")
  883. return s
  884. }
  885. func (this *Empty) String() string {
  886. if this == nil {
  887. return "nil"
  888. }
  889. s := strings.Join([]string{`&Empty{`,
  890. `}`,
  891. }, "")
  892. return s
  893. }
  894. func (this *ListAndWatchResponse) String() string {
  895. if this == nil {
  896. return "nil"
  897. }
  898. s := strings.Join([]string{`&ListAndWatchResponse{`,
  899. `Devices:` + strings.Replace(fmt.Sprintf("%v", this.Devices), "Device", "Device", 1) + `,`,
  900. `}`,
  901. }, "")
  902. return s
  903. }
  904. func (this *Device) String() string {
  905. if this == nil {
  906. return "nil"
  907. }
  908. s := strings.Join([]string{`&Device{`,
  909. `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  910. `Health:` + fmt.Sprintf("%v", this.Health) + `,`,
  911. `}`,
  912. }, "")
  913. return s
  914. }
  915. func (this *AllocateRequest) String() string {
  916. if this == nil {
  917. return "nil"
  918. }
  919. s := strings.Join([]string{`&AllocateRequest{`,
  920. `DevicesIDs:` + fmt.Sprintf("%v", this.DevicesIDs) + `,`,
  921. `}`,
  922. }, "")
  923. return s
  924. }
  925. func (this *AllocateResponse) String() string {
  926. if this == nil {
  927. return "nil"
  928. }
  929. keysForEnvs := make([]string, 0, len(this.Envs))
  930. for k := range this.Envs {
  931. keysForEnvs = append(keysForEnvs, k)
  932. }
  933. github_com_gogo_protobuf_sortkeys.Strings(keysForEnvs)
  934. mapStringForEnvs := "map[string]string{"
  935. for _, k := range keysForEnvs {
  936. mapStringForEnvs += fmt.Sprintf("%v: %v,", k, this.Envs[k])
  937. }
  938. mapStringForEnvs += "}"
  939. keysForAnnotations := make([]string, 0, len(this.Annotations))
  940. for k := range this.Annotations {
  941. keysForAnnotations = append(keysForAnnotations, k)
  942. }
  943. github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations)
  944. mapStringForAnnotations := "map[string]string{"
  945. for _, k := range keysForAnnotations {
  946. mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k])
  947. }
  948. mapStringForAnnotations += "}"
  949. s := strings.Join([]string{`&AllocateResponse{`,
  950. `Envs:` + mapStringForEnvs + `,`,
  951. `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "Mount", 1) + `,`,
  952. `Devices:` + strings.Replace(fmt.Sprintf("%v", this.Devices), "DeviceSpec", "DeviceSpec", 1) + `,`,
  953. `Annotations:` + mapStringForAnnotations + `,`,
  954. `}`,
  955. }, "")
  956. return s
  957. }
  958. func (this *Mount) String() string {
  959. if this == nil {
  960. return "nil"
  961. }
  962. s := strings.Join([]string{`&Mount{`,
  963. `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`,
  964. `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`,
  965. `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`,
  966. `}`,
  967. }, "")
  968. return s
  969. }
  970. func (this *DeviceSpec) String() string {
  971. if this == nil {
  972. return "nil"
  973. }
  974. s := strings.Join([]string{`&DeviceSpec{`,
  975. `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`,
  976. `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`,
  977. `Permissions:` + fmt.Sprintf("%v", this.Permissions) + `,`,
  978. `}`,
  979. }, "")
  980. return s
  981. }
  982. func valueToStringApi(v interface{}) string {
  983. rv := reflect.ValueOf(v)
  984. if rv.IsNil() {
  985. return "nil"
  986. }
  987. pv := reflect.Indirect(rv).Interface()
  988. return fmt.Sprintf("*%v", pv)
  989. }
  990. func (m *RegisterRequest) Unmarshal(dAtA []byte) error {
  991. l := len(dAtA)
  992. iNdEx := 0
  993. for iNdEx < l {
  994. preIndex := iNdEx
  995. var wire uint64
  996. for shift := uint(0); ; shift += 7 {
  997. if shift >= 64 {
  998. return ErrIntOverflowApi
  999. }
  1000. if iNdEx >= l {
  1001. return io.ErrUnexpectedEOF
  1002. }
  1003. b := dAtA[iNdEx]
  1004. iNdEx++
  1005. wire |= (uint64(b) & 0x7F) << shift
  1006. if b < 0x80 {
  1007. break
  1008. }
  1009. }
  1010. fieldNum := int32(wire >> 3)
  1011. wireType := int(wire & 0x7)
  1012. if wireType == 4 {
  1013. return fmt.Errorf("proto: RegisterRequest: wiretype end group for non-group")
  1014. }
  1015. if fieldNum <= 0 {
  1016. return fmt.Errorf("proto: RegisterRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1017. }
  1018. switch fieldNum {
  1019. case 1:
  1020. if wireType != 2 {
  1021. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  1022. }
  1023. var stringLen uint64
  1024. for shift := uint(0); ; shift += 7 {
  1025. if shift >= 64 {
  1026. return ErrIntOverflowApi
  1027. }
  1028. if iNdEx >= l {
  1029. return io.ErrUnexpectedEOF
  1030. }
  1031. b := dAtA[iNdEx]
  1032. iNdEx++
  1033. stringLen |= (uint64(b) & 0x7F) << shift
  1034. if b < 0x80 {
  1035. break
  1036. }
  1037. }
  1038. intStringLen := int(stringLen)
  1039. if intStringLen < 0 {
  1040. return ErrInvalidLengthApi
  1041. }
  1042. postIndex := iNdEx + intStringLen
  1043. if postIndex > l {
  1044. return io.ErrUnexpectedEOF
  1045. }
  1046. m.Version = string(dAtA[iNdEx:postIndex])
  1047. iNdEx = postIndex
  1048. case 2:
  1049. if wireType != 2 {
  1050. return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType)
  1051. }
  1052. var stringLen uint64
  1053. for shift := uint(0); ; shift += 7 {
  1054. if shift >= 64 {
  1055. return ErrIntOverflowApi
  1056. }
  1057. if iNdEx >= l {
  1058. return io.ErrUnexpectedEOF
  1059. }
  1060. b := dAtA[iNdEx]
  1061. iNdEx++
  1062. stringLen |= (uint64(b) & 0x7F) << shift
  1063. if b < 0x80 {
  1064. break
  1065. }
  1066. }
  1067. intStringLen := int(stringLen)
  1068. if intStringLen < 0 {
  1069. return ErrInvalidLengthApi
  1070. }
  1071. postIndex := iNdEx + intStringLen
  1072. if postIndex > l {
  1073. return io.ErrUnexpectedEOF
  1074. }
  1075. m.Endpoint = string(dAtA[iNdEx:postIndex])
  1076. iNdEx = postIndex
  1077. case 3:
  1078. if wireType != 2 {
  1079. return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType)
  1080. }
  1081. var stringLen uint64
  1082. for shift := uint(0); ; shift += 7 {
  1083. if shift >= 64 {
  1084. return ErrIntOverflowApi
  1085. }
  1086. if iNdEx >= l {
  1087. return io.ErrUnexpectedEOF
  1088. }
  1089. b := dAtA[iNdEx]
  1090. iNdEx++
  1091. stringLen |= (uint64(b) & 0x7F) << shift
  1092. if b < 0x80 {
  1093. break
  1094. }
  1095. }
  1096. intStringLen := int(stringLen)
  1097. if intStringLen < 0 {
  1098. return ErrInvalidLengthApi
  1099. }
  1100. postIndex := iNdEx + intStringLen
  1101. if postIndex > l {
  1102. return io.ErrUnexpectedEOF
  1103. }
  1104. m.ResourceName = string(dAtA[iNdEx:postIndex])
  1105. iNdEx = postIndex
  1106. default:
  1107. iNdEx = preIndex
  1108. skippy, err := skipApi(dAtA[iNdEx:])
  1109. if err != nil {
  1110. return err
  1111. }
  1112. if skippy < 0 {
  1113. return ErrInvalidLengthApi
  1114. }
  1115. if (iNdEx + skippy) > l {
  1116. return io.ErrUnexpectedEOF
  1117. }
  1118. iNdEx += skippy
  1119. }
  1120. }
  1121. if iNdEx > l {
  1122. return io.ErrUnexpectedEOF
  1123. }
  1124. return nil
  1125. }
  1126. func (m *Empty) Unmarshal(dAtA []byte) error {
  1127. l := len(dAtA)
  1128. iNdEx := 0
  1129. for iNdEx < l {
  1130. preIndex := iNdEx
  1131. var wire uint64
  1132. for shift := uint(0); ; shift += 7 {
  1133. if shift >= 64 {
  1134. return ErrIntOverflowApi
  1135. }
  1136. if iNdEx >= l {
  1137. return io.ErrUnexpectedEOF
  1138. }
  1139. b := dAtA[iNdEx]
  1140. iNdEx++
  1141. wire |= (uint64(b) & 0x7F) << shift
  1142. if b < 0x80 {
  1143. break
  1144. }
  1145. }
  1146. fieldNum := int32(wire >> 3)
  1147. wireType := int(wire & 0x7)
  1148. if wireType == 4 {
  1149. return fmt.Errorf("proto: Empty: wiretype end group for non-group")
  1150. }
  1151. if fieldNum <= 0 {
  1152. return fmt.Errorf("proto: Empty: illegal tag %d (wire type %d)", fieldNum, wire)
  1153. }
  1154. switch fieldNum {
  1155. default:
  1156. iNdEx = preIndex
  1157. skippy, err := skipApi(dAtA[iNdEx:])
  1158. if err != nil {
  1159. return err
  1160. }
  1161. if skippy < 0 {
  1162. return ErrInvalidLengthApi
  1163. }
  1164. if (iNdEx + skippy) > l {
  1165. return io.ErrUnexpectedEOF
  1166. }
  1167. iNdEx += skippy
  1168. }
  1169. }
  1170. if iNdEx > l {
  1171. return io.ErrUnexpectedEOF
  1172. }
  1173. return nil
  1174. }
  1175. func (m *ListAndWatchResponse) Unmarshal(dAtA []byte) error {
  1176. l := len(dAtA)
  1177. iNdEx := 0
  1178. for iNdEx < l {
  1179. preIndex := iNdEx
  1180. var wire uint64
  1181. for shift := uint(0); ; shift += 7 {
  1182. if shift >= 64 {
  1183. return ErrIntOverflowApi
  1184. }
  1185. if iNdEx >= l {
  1186. return io.ErrUnexpectedEOF
  1187. }
  1188. b := dAtA[iNdEx]
  1189. iNdEx++
  1190. wire |= (uint64(b) & 0x7F) << shift
  1191. if b < 0x80 {
  1192. break
  1193. }
  1194. }
  1195. fieldNum := int32(wire >> 3)
  1196. wireType := int(wire & 0x7)
  1197. if wireType == 4 {
  1198. return fmt.Errorf("proto: ListAndWatchResponse: wiretype end group for non-group")
  1199. }
  1200. if fieldNum <= 0 {
  1201. return fmt.Errorf("proto: ListAndWatchResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1202. }
  1203. switch fieldNum {
  1204. case 1:
  1205. if wireType != 2 {
  1206. return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType)
  1207. }
  1208. var msglen int
  1209. for shift := uint(0); ; shift += 7 {
  1210. if shift >= 64 {
  1211. return ErrIntOverflowApi
  1212. }
  1213. if iNdEx >= l {
  1214. return io.ErrUnexpectedEOF
  1215. }
  1216. b := dAtA[iNdEx]
  1217. iNdEx++
  1218. msglen |= (int(b) & 0x7F) << shift
  1219. if b < 0x80 {
  1220. break
  1221. }
  1222. }
  1223. if msglen < 0 {
  1224. return ErrInvalidLengthApi
  1225. }
  1226. postIndex := iNdEx + msglen
  1227. if postIndex > l {
  1228. return io.ErrUnexpectedEOF
  1229. }
  1230. m.Devices = append(m.Devices, &Device{})
  1231. if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1232. return err
  1233. }
  1234. iNdEx = postIndex
  1235. default:
  1236. iNdEx = preIndex
  1237. skippy, err := skipApi(dAtA[iNdEx:])
  1238. if err != nil {
  1239. return err
  1240. }
  1241. if skippy < 0 {
  1242. return ErrInvalidLengthApi
  1243. }
  1244. if (iNdEx + skippy) > l {
  1245. return io.ErrUnexpectedEOF
  1246. }
  1247. iNdEx += skippy
  1248. }
  1249. }
  1250. if iNdEx > l {
  1251. return io.ErrUnexpectedEOF
  1252. }
  1253. return nil
  1254. }
  1255. func (m *Device) Unmarshal(dAtA []byte) error {
  1256. l := len(dAtA)
  1257. iNdEx := 0
  1258. for iNdEx < l {
  1259. preIndex := iNdEx
  1260. var wire uint64
  1261. for shift := uint(0); ; shift += 7 {
  1262. if shift >= 64 {
  1263. return ErrIntOverflowApi
  1264. }
  1265. if iNdEx >= l {
  1266. return io.ErrUnexpectedEOF
  1267. }
  1268. b := dAtA[iNdEx]
  1269. iNdEx++
  1270. wire |= (uint64(b) & 0x7F) << shift
  1271. if b < 0x80 {
  1272. break
  1273. }
  1274. }
  1275. fieldNum := int32(wire >> 3)
  1276. wireType := int(wire & 0x7)
  1277. if wireType == 4 {
  1278. return fmt.Errorf("proto: Device: wiretype end group for non-group")
  1279. }
  1280. if fieldNum <= 0 {
  1281. return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire)
  1282. }
  1283. switch fieldNum {
  1284. case 1:
  1285. if wireType != 2 {
  1286. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  1287. }
  1288. var stringLen uint64
  1289. for shift := uint(0); ; shift += 7 {
  1290. if shift >= 64 {
  1291. return ErrIntOverflowApi
  1292. }
  1293. if iNdEx >= l {
  1294. return io.ErrUnexpectedEOF
  1295. }
  1296. b := dAtA[iNdEx]
  1297. iNdEx++
  1298. stringLen |= (uint64(b) & 0x7F) << shift
  1299. if b < 0x80 {
  1300. break
  1301. }
  1302. }
  1303. intStringLen := int(stringLen)
  1304. if intStringLen < 0 {
  1305. return ErrInvalidLengthApi
  1306. }
  1307. postIndex := iNdEx + intStringLen
  1308. if postIndex > l {
  1309. return io.ErrUnexpectedEOF
  1310. }
  1311. m.ID = string(dAtA[iNdEx:postIndex])
  1312. iNdEx = postIndex
  1313. case 2:
  1314. if wireType != 2 {
  1315. return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType)
  1316. }
  1317. var stringLen uint64
  1318. for shift := uint(0); ; shift += 7 {
  1319. if shift >= 64 {
  1320. return ErrIntOverflowApi
  1321. }
  1322. if iNdEx >= l {
  1323. return io.ErrUnexpectedEOF
  1324. }
  1325. b := dAtA[iNdEx]
  1326. iNdEx++
  1327. stringLen |= (uint64(b) & 0x7F) << shift
  1328. if b < 0x80 {
  1329. break
  1330. }
  1331. }
  1332. intStringLen := int(stringLen)
  1333. if intStringLen < 0 {
  1334. return ErrInvalidLengthApi
  1335. }
  1336. postIndex := iNdEx + intStringLen
  1337. if postIndex > l {
  1338. return io.ErrUnexpectedEOF
  1339. }
  1340. m.Health = string(dAtA[iNdEx:postIndex])
  1341. iNdEx = postIndex
  1342. default:
  1343. iNdEx = preIndex
  1344. skippy, err := skipApi(dAtA[iNdEx:])
  1345. if err != nil {
  1346. return err
  1347. }
  1348. if skippy < 0 {
  1349. return ErrInvalidLengthApi
  1350. }
  1351. if (iNdEx + skippy) > l {
  1352. return io.ErrUnexpectedEOF
  1353. }
  1354. iNdEx += skippy
  1355. }
  1356. }
  1357. if iNdEx > l {
  1358. return io.ErrUnexpectedEOF
  1359. }
  1360. return nil
  1361. }
  1362. func (m *AllocateRequest) Unmarshal(dAtA []byte) error {
  1363. l := len(dAtA)
  1364. iNdEx := 0
  1365. for iNdEx < l {
  1366. preIndex := iNdEx
  1367. var wire uint64
  1368. for shift := uint(0); ; shift += 7 {
  1369. if shift >= 64 {
  1370. return ErrIntOverflowApi
  1371. }
  1372. if iNdEx >= l {
  1373. return io.ErrUnexpectedEOF
  1374. }
  1375. b := dAtA[iNdEx]
  1376. iNdEx++
  1377. wire |= (uint64(b) & 0x7F) << shift
  1378. if b < 0x80 {
  1379. break
  1380. }
  1381. }
  1382. fieldNum := int32(wire >> 3)
  1383. wireType := int(wire & 0x7)
  1384. if wireType == 4 {
  1385. return fmt.Errorf("proto: AllocateRequest: wiretype end group for non-group")
  1386. }
  1387. if fieldNum <= 0 {
  1388. return fmt.Errorf("proto: AllocateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1389. }
  1390. switch fieldNum {
  1391. case 1:
  1392. if wireType != 2 {
  1393. return fmt.Errorf("proto: wrong wireType = %d for field DevicesIDs", wireType)
  1394. }
  1395. var stringLen uint64
  1396. for shift := uint(0); ; shift += 7 {
  1397. if shift >= 64 {
  1398. return ErrIntOverflowApi
  1399. }
  1400. if iNdEx >= l {
  1401. return io.ErrUnexpectedEOF
  1402. }
  1403. b := dAtA[iNdEx]
  1404. iNdEx++
  1405. stringLen |= (uint64(b) & 0x7F) << shift
  1406. if b < 0x80 {
  1407. break
  1408. }
  1409. }
  1410. intStringLen := int(stringLen)
  1411. if intStringLen < 0 {
  1412. return ErrInvalidLengthApi
  1413. }
  1414. postIndex := iNdEx + intStringLen
  1415. if postIndex > l {
  1416. return io.ErrUnexpectedEOF
  1417. }
  1418. m.DevicesIDs = append(m.DevicesIDs, string(dAtA[iNdEx:postIndex]))
  1419. iNdEx = postIndex
  1420. default:
  1421. iNdEx = preIndex
  1422. skippy, err := skipApi(dAtA[iNdEx:])
  1423. if err != nil {
  1424. return err
  1425. }
  1426. if skippy < 0 {
  1427. return ErrInvalidLengthApi
  1428. }
  1429. if (iNdEx + skippy) > l {
  1430. return io.ErrUnexpectedEOF
  1431. }
  1432. iNdEx += skippy
  1433. }
  1434. }
  1435. if iNdEx > l {
  1436. return io.ErrUnexpectedEOF
  1437. }
  1438. return nil
  1439. }
  1440. func (m *AllocateResponse) Unmarshal(dAtA []byte) error {
  1441. l := len(dAtA)
  1442. iNdEx := 0
  1443. for iNdEx < l {
  1444. preIndex := iNdEx
  1445. var wire uint64
  1446. for shift := uint(0); ; shift += 7 {
  1447. if shift >= 64 {
  1448. return ErrIntOverflowApi
  1449. }
  1450. if iNdEx >= l {
  1451. return io.ErrUnexpectedEOF
  1452. }
  1453. b := dAtA[iNdEx]
  1454. iNdEx++
  1455. wire |= (uint64(b) & 0x7F) << shift
  1456. if b < 0x80 {
  1457. break
  1458. }
  1459. }
  1460. fieldNum := int32(wire >> 3)
  1461. wireType := int(wire & 0x7)
  1462. if wireType == 4 {
  1463. return fmt.Errorf("proto: AllocateResponse: wiretype end group for non-group")
  1464. }
  1465. if fieldNum <= 0 {
  1466. return fmt.Errorf("proto: AllocateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1467. }
  1468. switch fieldNum {
  1469. case 1:
  1470. if wireType != 2 {
  1471. return fmt.Errorf("proto: wrong wireType = %d for field Envs", wireType)
  1472. }
  1473. var msglen int
  1474. for shift := uint(0); ; shift += 7 {
  1475. if shift >= 64 {
  1476. return ErrIntOverflowApi
  1477. }
  1478. if iNdEx >= l {
  1479. return io.ErrUnexpectedEOF
  1480. }
  1481. b := dAtA[iNdEx]
  1482. iNdEx++
  1483. msglen |= (int(b) & 0x7F) << shift
  1484. if b < 0x80 {
  1485. break
  1486. }
  1487. }
  1488. if msglen < 0 {
  1489. return ErrInvalidLengthApi
  1490. }
  1491. postIndex := iNdEx + msglen
  1492. if postIndex > l {
  1493. return io.ErrUnexpectedEOF
  1494. }
  1495. if m.Envs == nil {
  1496. m.Envs = make(map[string]string)
  1497. }
  1498. var mapkey string
  1499. var mapvalue string
  1500. for iNdEx < postIndex {
  1501. entryPreIndex := iNdEx
  1502. var wire uint64
  1503. for shift := uint(0); ; shift += 7 {
  1504. if shift >= 64 {
  1505. return ErrIntOverflowApi
  1506. }
  1507. if iNdEx >= l {
  1508. return io.ErrUnexpectedEOF
  1509. }
  1510. b := dAtA[iNdEx]
  1511. iNdEx++
  1512. wire |= (uint64(b) & 0x7F) << shift
  1513. if b < 0x80 {
  1514. break
  1515. }
  1516. }
  1517. fieldNum := int32(wire >> 3)
  1518. if fieldNum == 1 {
  1519. var stringLenmapkey uint64
  1520. for shift := uint(0); ; shift += 7 {
  1521. if shift >= 64 {
  1522. return ErrIntOverflowApi
  1523. }
  1524. if iNdEx >= l {
  1525. return io.ErrUnexpectedEOF
  1526. }
  1527. b := dAtA[iNdEx]
  1528. iNdEx++
  1529. stringLenmapkey |= (uint64(b) & 0x7F) << shift
  1530. if b < 0x80 {
  1531. break
  1532. }
  1533. }
  1534. intStringLenmapkey := int(stringLenmapkey)
  1535. if intStringLenmapkey < 0 {
  1536. return ErrInvalidLengthApi
  1537. }
  1538. postStringIndexmapkey := iNdEx + intStringLenmapkey
  1539. if postStringIndexmapkey > l {
  1540. return io.ErrUnexpectedEOF
  1541. }
  1542. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  1543. iNdEx = postStringIndexmapkey
  1544. } else if fieldNum == 2 {
  1545. var stringLenmapvalue uint64
  1546. for shift := uint(0); ; shift += 7 {
  1547. if shift >= 64 {
  1548. return ErrIntOverflowApi
  1549. }
  1550. if iNdEx >= l {
  1551. return io.ErrUnexpectedEOF
  1552. }
  1553. b := dAtA[iNdEx]
  1554. iNdEx++
  1555. stringLenmapvalue |= (uint64(b) & 0x7F) << shift
  1556. if b < 0x80 {
  1557. break
  1558. }
  1559. }
  1560. intStringLenmapvalue := int(stringLenmapvalue)
  1561. if intStringLenmapvalue < 0 {
  1562. return ErrInvalidLengthApi
  1563. }
  1564. postStringIndexmapvalue := iNdEx + intStringLenmapvalue
  1565. if postStringIndexmapvalue > l {
  1566. return io.ErrUnexpectedEOF
  1567. }
  1568. mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
  1569. iNdEx = postStringIndexmapvalue
  1570. } else {
  1571. iNdEx = entryPreIndex
  1572. skippy, err := skipApi(dAtA[iNdEx:])
  1573. if err != nil {
  1574. return err
  1575. }
  1576. if skippy < 0 {
  1577. return ErrInvalidLengthApi
  1578. }
  1579. if (iNdEx + skippy) > postIndex {
  1580. return io.ErrUnexpectedEOF
  1581. }
  1582. iNdEx += skippy
  1583. }
  1584. }
  1585. m.Envs[mapkey] = mapvalue
  1586. iNdEx = postIndex
  1587. case 2:
  1588. if wireType != 2 {
  1589. return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType)
  1590. }
  1591. var msglen int
  1592. for shift := uint(0); ; shift += 7 {
  1593. if shift >= 64 {
  1594. return ErrIntOverflowApi
  1595. }
  1596. if iNdEx >= l {
  1597. return io.ErrUnexpectedEOF
  1598. }
  1599. b := dAtA[iNdEx]
  1600. iNdEx++
  1601. msglen |= (int(b) & 0x7F) << shift
  1602. if b < 0x80 {
  1603. break
  1604. }
  1605. }
  1606. if msglen < 0 {
  1607. return ErrInvalidLengthApi
  1608. }
  1609. postIndex := iNdEx + msglen
  1610. if postIndex > l {
  1611. return io.ErrUnexpectedEOF
  1612. }
  1613. m.Mounts = append(m.Mounts, &Mount{})
  1614. if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1615. return err
  1616. }
  1617. iNdEx = postIndex
  1618. case 3:
  1619. if wireType != 2 {
  1620. return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType)
  1621. }
  1622. var msglen int
  1623. for shift := uint(0); ; shift += 7 {
  1624. if shift >= 64 {
  1625. return ErrIntOverflowApi
  1626. }
  1627. if iNdEx >= l {
  1628. return io.ErrUnexpectedEOF
  1629. }
  1630. b := dAtA[iNdEx]
  1631. iNdEx++
  1632. msglen |= (int(b) & 0x7F) << shift
  1633. if b < 0x80 {
  1634. break
  1635. }
  1636. }
  1637. if msglen < 0 {
  1638. return ErrInvalidLengthApi
  1639. }
  1640. postIndex := iNdEx + msglen
  1641. if postIndex > l {
  1642. return io.ErrUnexpectedEOF
  1643. }
  1644. m.Devices = append(m.Devices, &DeviceSpec{})
  1645. if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1646. return err
  1647. }
  1648. iNdEx = postIndex
  1649. case 4:
  1650. if wireType != 2 {
  1651. return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType)
  1652. }
  1653. var msglen int
  1654. for shift := uint(0); ; shift += 7 {
  1655. if shift >= 64 {
  1656. return ErrIntOverflowApi
  1657. }
  1658. if iNdEx >= l {
  1659. return io.ErrUnexpectedEOF
  1660. }
  1661. b := dAtA[iNdEx]
  1662. iNdEx++
  1663. msglen |= (int(b) & 0x7F) << shift
  1664. if b < 0x80 {
  1665. break
  1666. }
  1667. }
  1668. if msglen < 0 {
  1669. return ErrInvalidLengthApi
  1670. }
  1671. postIndex := iNdEx + msglen
  1672. if postIndex > l {
  1673. return io.ErrUnexpectedEOF
  1674. }
  1675. if m.Annotations == nil {
  1676. m.Annotations = make(map[string]string)
  1677. }
  1678. var mapkey string
  1679. var mapvalue string
  1680. for iNdEx < postIndex {
  1681. entryPreIndex := iNdEx
  1682. var wire uint64
  1683. for shift := uint(0); ; shift += 7 {
  1684. if shift >= 64 {
  1685. return ErrIntOverflowApi
  1686. }
  1687. if iNdEx >= l {
  1688. return io.ErrUnexpectedEOF
  1689. }
  1690. b := dAtA[iNdEx]
  1691. iNdEx++
  1692. wire |= (uint64(b) & 0x7F) << shift
  1693. if b < 0x80 {
  1694. break
  1695. }
  1696. }
  1697. fieldNum := int32(wire >> 3)
  1698. if fieldNum == 1 {
  1699. var stringLenmapkey uint64
  1700. for shift := uint(0); ; shift += 7 {
  1701. if shift >= 64 {
  1702. return ErrIntOverflowApi
  1703. }
  1704. if iNdEx >= l {
  1705. return io.ErrUnexpectedEOF
  1706. }
  1707. b := dAtA[iNdEx]
  1708. iNdEx++
  1709. stringLenmapkey |= (uint64(b) & 0x7F) << shift
  1710. if b < 0x80 {
  1711. break
  1712. }
  1713. }
  1714. intStringLenmapkey := int(stringLenmapkey)
  1715. if intStringLenmapkey < 0 {
  1716. return ErrInvalidLengthApi
  1717. }
  1718. postStringIndexmapkey := iNdEx + intStringLenmapkey
  1719. if postStringIndexmapkey > l {
  1720. return io.ErrUnexpectedEOF
  1721. }
  1722. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  1723. iNdEx = postStringIndexmapkey
  1724. } else if fieldNum == 2 {
  1725. var stringLenmapvalue uint64
  1726. for shift := uint(0); ; shift += 7 {
  1727. if shift >= 64 {
  1728. return ErrIntOverflowApi
  1729. }
  1730. if iNdEx >= l {
  1731. return io.ErrUnexpectedEOF
  1732. }
  1733. b := dAtA[iNdEx]
  1734. iNdEx++
  1735. stringLenmapvalue |= (uint64(b) & 0x7F) << shift
  1736. if b < 0x80 {
  1737. break
  1738. }
  1739. }
  1740. intStringLenmapvalue := int(stringLenmapvalue)
  1741. if intStringLenmapvalue < 0 {
  1742. return ErrInvalidLengthApi
  1743. }
  1744. postStringIndexmapvalue := iNdEx + intStringLenmapvalue
  1745. if postStringIndexmapvalue > l {
  1746. return io.ErrUnexpectedEOF
  1747. }
  1748. mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
  1749. iNdEx = postStringIndexmapvalue
  1750. } else {
  1751. iNdEx = entryPreIndex
  1752. skippy, err := skipApi(dAtA[iNdEx:])
  1753. if err != nil {
  1754. return err
  1755. }
  1756. if skippy < 0 {
  1757. return ErrInvalidLengthApi
  1758. }
  1759. if (iNdEx + skippy) > postIndex {
  1760. return io.ErrUnexpectedEOF
  1761. }
  1762. iNdEx += skippy
  1763. }
  1764. }
  1765. m.Annotations[mapkey] = mapvalue
  1766. iNdEx = postIndex
  1767. default:
  1768. iNdEx = preIndex
  1769. skippy, err := skipApi(dAtA[iNdEx:])
  1770. if err != nil {
  1771. return err
  1772. }
  1773. if skippy < 0 {
  1774. return ErrInvalidLengthApi
  1775. }
  1776. if (iNdEx + skippy) > l {
  1777. return io.ErrUnexpectedEOF
  1778. }
  1779. iNdEx += skippy
  1780. }
  1781. }
  1782. if iNdEx > l {
  1783. return io.ErrUnexpectedEOF
  1784. }
  1785. return nil
  1786. }
  1787. func (m *Mount) Unmarshal(dAtA []byte) error {
  1788. l := len(dAtA)
  1789. iNdEx := 0
  1790. for iNdEx < l {
  1791. preIndex := iNdEx
  1792. var wire uint64
  1793. for shift := uint(0); ; shift += 7 {
  1794. if shift >= 64 {
  1795. return ErrIntOverflowApi
  1796. }
  1797. if iNdEx >= l {
  1798. return io.ErrUnexpectedEOF
  1799. }
  1800. b := dAtA[iNdEx]
  1801. iNdEx++
  1802. wire |= (uint64(b) & 0x7F) << shift
  1803. if b < 0x80 {
  1804. break
  1805. }
  1806. }
  1807. fieldNum := int32(wire >> 3)
  1808. wireType := int(wire & 0x7)
  1809. if wireType == 4 {
  1810. return fmt.Errorf("proto: Mount: wiretype end group for non-group")
  1811. }
  1812. if fieldNum <= 0 {
  1813. return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire)
  1814. }
  1815. switch fieldNum {
  1816. case 1:
  1817. if wireType != 2 {
  1818. return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType)
  1819. }
  1820. var stringLen uint64
  1821. for shift := uint(0); ; shift += 7 {
  1822. if shift >= 64 {
  1823. return ErrIntOverflowApi
  1824. }
  1825. if iNdEx >= l {
  1826. return io.ErrUnexpectedEOF
  1827. }
  1828. b := dAtA[iNdEx]
  1829. iNdEx++
  1830. stringLen |= (uint64(b) & 0x7F) << shift
  1831. if b < 0x80 {
  1832. break
  1833. }
  1834. }
  1835. intStringLen := int(stringLen)
  1836. if intStringLen < 0 {
  1837. return ErrInvalidLengthApi
  1838. }
  1839. postIndex := iNdEx + intStringLen
  1840. if postIndex > l {
  1841. return io.ErrUnexpectedEOF
  1842. }
  1843. m.ContainerPath = string(dAtA[iNdEx:postIndex])
  1844. iNdEx = postIndex
  1845. case 2:
  1846. if wireType != 2 {
  1847. return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType)
  1848. }
  1849. var stringLen uint64
  1850. for shift := uint(0); ; shift += 7 {
  1851. if shift >= 64 {
  1852. return ErrIntOverflowApi
  1853. }
  1854. if iNdEx >= l {
  1855. return io.ErrUnexpectedEOF
  1856. }
  1857. b := dAtA[iNdEx]
  1858. iNdEx++
  1859. stringLen |= (uint64(b) & 0x7F) << shift
  1860. if b < 0x80 {
  1861. break
  1862. }
  1863. }
  1864. intStringLen := int(stringLen)
  1865. if intStringLen < 0 {
  1866. return ErrInvalidLengthApi
  1867. }
  1868. postIndex := iNdEx + intStringLen
  1869. if postIndex > l {
  1870. return io.ErrUnexpectedEOF
  1871. }
  1872. m.HostPath = string(dAtA[iNdEx:postIndex])
  1873. iNdEx = postIndex
  1874. case 3:
  1875. if wireType != 0 {
  1876. return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType)
  1877. }
  1878. var v int
  1879. for shift := uint(0); ; shift += 7 {
  1880. if shift >= 64 {
  1881. return ErrIntOverflowApi
  1882. }
  1883. if iNdEx >= l {
  1884. return io.ErrUnexpectedEOF
  1885. }
  1886. b := dAtA[iNdEx]
  1887. iNdEx++
  1888. v |= (int(b) & 0x7F) << shift
  1889. if b < 0x80 {
  1890. break
  1891. }
  1892. }
  1893. m.ReadOnly = bool(v != 0)
  1894. default:
  1895. iNdEx = preIndex
  1896. skippy, err := skipApi(dAtA[iNdEx:])
  1897. if err != nil {
  1898. return err
  1899. }
  1900. if skippy < 0 {
  1901. return ErrInvalidLengthApi
  1902. }
  1903. if (iNdEx + skippy) > l {
  1904. return io.ErrUnexpectedEOF
  1905. }
  1906. iNdEx += skippy
  1907. }
  1908. }
  1909. if iNdEx > l {
  1910. return io.ErrUnexpectedEOF
  1911. }
  1912. return nil
  1913. }
  1914. func (m *DeviceSpec) Unmarshal(dAtA []byte) error {
  1915. l := len(dAtA)
  1916. iNdEx := 0
  1917. for iNdEx < l {
  1918. preIndex := iNdEx
  1919. var wire uint64
  1920. for shift := uint(0); ; shift += 7 {
  1921. if shift >= 64 {
  1922. return ErrIntOverflowApi
  1923. }
  1924. if iNdEx >= l {
  1925. return io.ErrUnexpectedEOF
  1926. }
  1927. b := dAtA[iNdEx]
  1928. iNdEx++
  1929. wire |= (uint64(b) & 0x7F) << shift
  1930. if b < 0x80 {
  1931. break
  1932. }
  1933. }
  1934. fieldNum := int32(wire >> 3)
  1935. wireType := int(wire & 0x7)
  1936. if wireType == 4 {
  1937. return fmt.Errorf("proto: DeviceSpec: wiretype end group for non-group")
  1938. }
  1939. if fieldNum <= 0 {
  1940. return fmt.Errorf("proto: DeviceSpec: illegal tag %d (wire type %d)", fieldNum, wire)
  1941. }
  1942. switch fieldNum {
  1943. case 1:
  1944. if wireType != 2 {
  1945. return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType)
  1946. }
  1947. var stringLen uint64
  1948. for shift := uint(0); ; shift += 7 {
  1949. if shift >= 64 {
  1950. return ErrIntOverflowApi
  1951. }
  1952. if iNdEx >= l {
  1953. return io.ErrUnexpectedEOF
  1954. }
  1955. b := dAtA[iNdEx]
  1956. iNdEx++
  1957. stringLen |= (uint64(b) & 0x7F) << shift
  1958. if b < 0x80 {
  1959. break
  1960. }
  1961. }
  1962. intStringLen := int(stringLen)
  1963. if intStringLen < 0 {
  1964. return ErrInvalidLengthApi
  1965. }
  1966. postIndex := iNdEx + intStringLen
  1967. if postIndex > l {
  1968. return io.ErrUnexpectedEOF
  1969. }
  1970. m.ContainerPath = string(dAtA[iNdEx:postIndex])
  1971. iNdEx = postIndex
  1972. case 2:
  1973. if wireType != 2 {
  1974. return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType)
  1975. }
  1976. var stringLen uint64
  1977. for shift := uint(0); ; shift += 7 {
  1978. if shift >= 64 {
  1979. return ErrIntOverflowApi
  1980. }
  1981. if iNdEx >= l {
  1982. return io.ErrUnexpectedEOF
  1983. }
  1984. b := dAtA[iNdEx]
  1985. iNdEx++
  1986. stringLen |= (uint64(b) & 0x7F) << shift
  1987. if b < 0x80 {
  1988. break
  1989. }
  1990. }
  1991. intStringLen := int(stringLen)
  1992. if intStringLen < 0 {
  1993. return ErrInvalidLengthApi
  1994. }
  1995. postIndex := iNdEx + intStringLen
  1996. if postIndex > l {
  1997. return io.ErrUnexpectedEOF
  1998. }
  1999. m.HostPath = string(dAtA[iNdEx:postIndex])
  2000. iNdEx = postIndex
  2001. case 3:
  2002. if wireType != 2 {
  2003. return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType)
  2004. }
  2005. var stringLen uint64
  2006. for shift := uint(0); ; shift += 7 {
  2007. if shift >= 64 {
  2008. return ErrIntOverflowApi
  2009. }
  2010. if iNdEx >= l {
  2011. return io.ErrUnexpectedEOF
  2012. }
  2013. b := dAtA[iNdEx]
  2014. iNdEx++
  2015. stringLen |= (uint64(b) & 0x7F) << shift
  2016. if b < 0x80 {
  2017. break
  2018. }
  2019. }
  2020. intStringLen := int(stringLen)
  2021. if intStringLen < 0 {
  2022. return ErrInvalidLengthApi
  2023. }
  2024. postIndex := iNdEx + intStringLen
  2025. if postIndex > l {
  2026. return io.ErrUnexpectedEOF
  2027. }
  2028. m.Permissions = string(dAtA[iNdEx:postIndex])
  2029. iNdEx = postIndex
  2030. default:
  2031. iNdEx = preIndex
  2032. skippy, err := skipApi(dAtA[iNdEx:])
  2033. if err != nil {
  2034. return err
  2035. }
  2036. if skippy < 0 {
  2037. return ErrInvalidLengthApi
  2038. }
  2039. if (iNdEx + skippy) > l {
  2040. return io.ErrUnexpectedEOF
  2041. }
  2042. iNdEx += skippy
  2043. }
  2044. }
  2045. if iNdEx > l {
  2046. return io.ErrUnexpectedEOF
  2047. }
  2048. return nil
  2049. }
  2050. func skipApi(dAtA []byte) (n int, err error) {
  2051. l := len(dAtA)
  2052. iNdEx := 0
  2053. for iNdEx < l {
  2054. var wire uint64
  2055. for shift := uint(0); ; shift += 7 {
  2056. if shift >= 64 {
  2057. return 0, ErrIntOverflowApi
  2058. }
  2059. if iNdEx >= l {
  2060. return 0, io.ErrUnexpectedEOF
  2061. }
  2062. b := dAtA[iNdEx]
  2063. iNdEx++
  2064. wire |= (uint64(b) & 0x7F) << shift
  2065. if b < 0x80 {
  2066. break
  2067. }
  2068. }
  2069. wireType := int(wire & 0x7)
  2070. switch wireType {
  2071. case 0:
  2072. for shift := uint(0); ; shift += 7 {
  2073. if shift >= 64 {
  2074. return 0, ErrIntOverflowApi
  2075. }
  2076. if iNdEx >= l {
  2077. return 0, io.ErrUnexpectedEOF
  2078. }
  2079. iNdEx++
  2080. if dAtA[iNdEx-1] < 0x80 {
  2081. break
  2082. }
  2083. }
  2084. return iNdEx, nil
  2085. case 1:
  2086. iNdEx += 8
  2087. return iNdEx, nil
  2088. case 2:
  2089. var length int
  2090. for shift := uint(0); ; shift += 7 {
  2091. if shift >= 64 {
  2092. return 0, ErrIntOverflowApi
  2093. }
  2094. if iNdEx >= l {
  2095. return 0, io.ErrUnexpectedEOF
  2096. }
  2097. b := dAtA[iNdEx]
  2098. iNdEx++
  2099. length |= (int(b) & 0x7F) << shift
  2100. if b < 0x80 {
  2101. break
  2102. }
  2103. }
  2104. iNdEx += length
  2105. if length < 0 {
  2106. return 0, ErrInvalidLengthApi
  2107. }
  2108. return iNdEx, nil
  2109. case 3:
  2110. for {
  2111. var innerWire uint64
  2112. var start int = iNdEx
  2113. for shift := uint(0); ; shift += 7 {
  2114. if shift >= 64 {
  2115. return 0, ErrIntOverflowApi
  2116. }
  2117. if iNdEx >= l {
  2118. return 0, io.ErrUnexpectedEOF
  2119. }
  2120. b := dAtA[iNdEx]
  2121. iNdEx++
  2122. innerWire |= (uint64(b) & 0x7F) << shift
  2123. if b < 0x80 {
  2124. break
  2125. }
  2126. }
  2127. innerWireType := int(innerWire & 0x7)
  2128. if innerWireType == 4 {
  2129. break
  2130. }
  2131. next, err := skipApi(dAtA[start:])
  2132. if err != nil {
  2133. return 0, err
  2134. }
  2135. iNdEx = start + next
  2136. }
  2137. return iNdEx, nil
  2138. case 4:
  2139. return iNdEx, nil
  2140. case 5:
  2141. iNdEx += 4
  2142. return iNdEx, nil
  2143. default:
  2144. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2145. }
  2146. }
  2147. panic("unreachable")
  2148. }
  2149. var (
  2150. ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
  2151. ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
  2152. )
  2153. func init() { proto.RegisterFile("api.proto", fileDescriptorApi) }
  2154. var fileDescriptorApi = []byte{
  2155. // 594 bytes of a gzipped FileDescriptorProto
  2156. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x5d, 0x8b, 0xd3, 0x40,
  2157. 0x14, 0x6d, 0xd2, 0xdd, 0x6e, 0x7b, 0xdb, 0xdd, 0x2d, 0x63, 0x91, 0x10, 0x35, 0x94, 0x88, 0x50,
  2158. 0x10, 0xd3, 0xb5, 0x3e, 0x28, 0x22, 0x62, 0xa5, 0x15, 0x96, 0xf5, 0xa3, 0xc6, 0x07, 0x1f, 0xcb,
  2159. 0x34, 0x1d, 0x9b, 0xc1, 0x64, 0x26, 0x66, 0x26, 0x85, 0xbe, 0xf9, 0x13, 0xfc, 0x19, 0xfe, 0x94,
  2160. 0x7d, 0xf4, 0xd1, 0x47, 0xb7, 0xfe, 0x0e, 0x41, 0x3a, 0x49, 0xfa, 0x11, 0x8a, 0x22, 0xf8, 0x96,
  2161. 0x7b, 0xe6, 0x9e, 0xc9, 0xb9, 0x27, 0xf7, 0x04, 0x6a, 0x38, 0xa2, 0x4e, 0x14, 0x73, 0xc9, 0x51,
  2162. 0x63, 0x4a, 0xe6, 0xd4, 0x23, 0x51, 0x90, 0xcc, 0x28, 0x33, 0xef, 0xcd, 0xa8, 0xf4, 0x93, 0x89,
  2163. 0xe3, 0xf1, 0xb0, 0x3b, 0xe3, 0x33, 0xde, 0x55, 0x4d, 0x93, 0xe4, 0x83, 0xaa, 0x54, 0xa1, 0x9e,
  2164. 0x52, 0xb2, 0x1d, 0xc0, 0xa9, 0x4b, 0x66, 0x54, 0x48, 0x12, 0xbb, 0xe4, 0x53, 0x42, 0x84, 0x44,
  2165. 0x06, 0x1c, 0xcd, 0x49, 0x2c, 0x28, 0x67, 0x86, 0xd6, 0xd6, 0x3a, 0x35, 0x37, 0x2f, 0x91, 0x09,
  2166. 0x55, 0xc2, 0xa6, 0x11, 0xa7, 0x4c, 0x1a, 0xba, 0x3a, 0x5a, 0xd7, 0xe8, 0x36, 0x1c, 0xc7, 0x44,
  2167. 0xf0, 0x24, 0xf6, 0xc8, 0x98, 0xe1, 0x90, 0x18, 0x65, 0xd5, 0xd0, 0xc8, 0xc1, 0xd7, 0x38, 0x24,
  2168. 0xf6, 0x11, 0x1c, 0x0e, 0xc3, 0x48, 0x2e, 0xec, 0x17, 0xd0, 0x7a, 0x49, 0x85, 0xec, 0xb3, 0xe9,
  2169. 0x7b, 0x2c, 0x3d, 0xdf, 0x25, 0x22, 0xe2, 0x4c, 0x10, 0xe4, 0xc0, 0x51, 0x3a, 0x8d, 0x30, 0xb4,
  2170. 0x76, 0xb9, 0x53, 0xef, 0xb5, 0x9c, 0xed, 0xe9, 0x9c, 0x81, 0x2a, 0xdc, 0xbc, 0xc9, 0x3e, 0x83,
  2171. 0x4a, 0x0a, 0xa1, 0x13, 0xd0, 0xcf, 0x07, 0x99, 0x60, 0x9d, 0x0e, 0xd0, 0x75, 0xa8, 0xf8, 0x04,
  2172. 0x07, 0xd2, 0xcf, 0x94, 0x66, 0x95, 0x7d, 0x1f, 0x4e, 0xfb, 0x41, 0xc0, 0x3d, 0x2c, 0x49, 0x3e,
  2173. 0xb0, 0x05, 0x90, 0xdd, 0x77, 0x3e, 0x48, 0xdf, 0x5b, 0x73, 0xb7, 0x10, 0xfb, 0x97, 0x0e, 0xcd,
  2174. 0x0d, 0x27, 0x53, 0xfa, 0x04, 0x0e, 0x08, 0x9b, 0xe7, 0x32, 0x3b, 0xbb, 0x32, 0x8b, 0xdd, 0xce,
  2175. 0x90, 0xcd, 0xc5, 0x90, 0xc9, 0x78, 0xe1, 0x2a, 0x16, 0xba, 0x0b, 0x95, 0x90, 0x27, 0x4c, 0x0a,
  2176. 0x43, 0x57, 0xfc, 0x6b, 0xbb, 0xfc, 0x57, 0xab, 0x33, 0x37, 0x6b, 0x41, 0xbd, 0x8d, 0x29, 0x65,
  2177. 0xd5, 0x6d, 0xec, 0x33, 0xe5, 0x5d, 0x44, 0xbc, 0xb5, 0x31, 0xe8, 0x2d, 0xd4, 0x31, 0x63, 0x5c,
  2178. 0x62, 0x49, 0x39, 0x13, 0xc6, 0x81, 0xe2, 0x75, 0xff, 0xa2, 0xb2, 0xbf, 0x61, 0xa4, 0x62, 0xb7,
  2179. 0xef, 0x30, 0x1f, 0x42, 0x6d, 0x3d, 0x06, 0x6a, 0x42, 0xf9, 0x23, 0x59, 0x64, 0x7e, 0xaf, 0x1e,
  2180. 0x51, 0x0b, 0x0e, 0xe7, 0x38, 0x48, 0x48, 0xe6, 0x77, 0x5a, 0x3c, 0xd6, 0x1f, 0x69, 0xe6, 0x53,
  2181. 0x68, 0x16, 0x6f, 0xfe, 0x17, 0xbe, 0xed, 0xc3, 0xa1, 0x32, 0x04, 0xdd, 0x81, 0x13, 0x8f, 0x33,
  2182. 0x89, 0x29, 0x23, 0xf1, 0x38, 0xc2, 0xd2, 0xcf, 0xf8, 0xc7, 0x6b, 0x74, 0x84, 0xa5, 0x8f, 0x6e,
  2183. 0x40, 0xcd, 0xe7, 0x42, 0xa6, 0x1d, 0xd9, 0x9e, 0xae, 0x80, 0xfc, 0x30, 0x26, 0x78, 0x3a, 0xe6,
  2184. 0x2c, 0x58, 0xa8, 0x1d, 0xad, 0xba, 0xd5, 0x15, 0xf0, 0x86, 0x05, 0x0b, 0x3b, 0x06, 0xd8, 0x98,
  2185. 0xf9, 0x5f, 0x5e, 0xd7, 0x86, 0x7a, 0x44, 0xe2, 0x90, 0x0a, 0xa1, 0xbe, 0x43, 0x1a, 0x8a, 0x6d,
  2186. 0xa8, 0x37, 0x82, 0x46, 0x9a, 0xc0, 0x58, 0xf9, 0x83, 0x9e, 0x41, 0x35, 0x4f, 0x24, 0xba, 0xb5,
  2187. 0xfb, 0xc1, 0x0a, 0x49, 0x35, 0x0b, 0x5b, 0x93, 0x46, 0xab, 0xd4, 0xfb, 0xaa, 0x41, 0x23, 0x1d,
  2188. 0x63, 0xa4, 0x0e, 0xd0, 0x05, 0x34, 0xb6, 0xd3, 0x86, 0xf6, 0xf1, 0x4c, 0x7b, 0x17, 0xdc, 0x17,
  2189. 0x4f, 0xbb, 0x74, 0xa6, 0xa1, 0x0b, 0xa8, 0xe6, 0x8b, 0x53, 0xd4, 0x57, 0x08, 0x96, 0x69, 0xfd,
  2190. 0x79, 0xdf, 0xec, 0xd2, 0xf3, 0x9b, 0x97, 0x57, 0x96, 0xf6, 0xfd, 0xca, 0x2a, 0x7d, 0x5e, 0x5a,
  2191. 0xda, 0xe5, 0xd2, 0xd2, 0xbe, 0x2d, 0x2d, 0xed, 0xc7, 0xd2, 0xd2, 0xbe, 0xfc, 0xb4, 0x4a, 0x93,
  2192. 0x8a, 0xfa, 0x47, 0x3d, 0xf8, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x67, 0x68, 0xfd, 0xfd, 0xed, 0x04,
  2193. 0x00, 0x00,
  2194. }