api.pb.go 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  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. package v1alpha1
  16. import (
  17. context "context"
  18. fmt "fmt"
  19. _ "github.com/gogo/protobuf/gogoproto"
  20. proto "github.com/gogo/protobuf/proto"
  21. grpc "google.golang.org/grpc"
  22. codes "google.golang.org/grpc/codes"
  23. status "google.golang.org/grpc/status"
  24. io "io"
  25. math "math"
  26. math_bits "math/bits"
  27. reflect "reflect"
  28. strings "strings"
  29. )
  30. // Reference imports to suppress errors if they are not otherwise used.
  31. var _ = proto.Marshal
  32. var _ = fmt.Errorf
  33. var _ = math.Inf
  34. // This is a compile-time assertion to ensure that this generated file
  35. // is compatible with the proto package it is being compiled against.
  36. // A compilation error at this line likely means your copy of the
  37. // proto package needs to be updated.
  38. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  39. // ListPodResourcesRequest is the request made to the PodResourcesLister service
  40. type ListPodResourcesRequest struct {
  41. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  42. XXX_sizecache int32 `json:"-"`
  43. }
  44. func (m *ListPodResourcesRequest) Reset() { *m = ListPodResourcesRequest{} }
  45. func (*ListPodResourcesRequest) ProtoMessage() {}
  46. func (*ListPodResourcesRequest) Descriptor() ([]byte, []int) {
  47. return fileDescriptor_00212fb1f9d3bf1c, []int{0}
  48. }
  49. func (m *ListPodResourcesRequest) XXX_Unmarshal(b []byte) error {
  50. return m.Unmarshal(b)
  51. }
  52. func (m *ListPodResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  53. if deterministic {
  54. return xxx_messageInfo_ListPodResourcesRequest.Marshal(b, m, deterministic)
  55. } else {
  56. b = b[:cap(b)]
  57. n, err := m.MarshalToSizedBuffer(b)
  58. if err != nil {
  59. return nil, err
  60. }
  61. return b[:n], nil
  62. }
  63. }
  64. func (m *ListPodResourcesRequest) XXX_Merge(src proto.Message) {
  65. xxx_messageInfo_ListPodResourcesRequest.Merge(m, src)
  66. }
  67. func (m *ListPodResourcesRequest) XXX_Size() int {
  68. return m.Size()
  69. }
  70. func (m *ListPodResourcesRequest) XXX_DiscardUnknown() {
  71. xxx_messageInfo_ListPodResourcesRequest.DiscardUnknown(m)
  72. }
  73. var xxx_messageInfo_ListPodResourcesRequest proto.InternalMessageInfo
  74. // ListPodResourcesResponse is the response returned by List function
  75. type ListPodResourcesResponse struct {
  76. PodResources []*PodResources `protobuf:"bytes,1,rep,name=pod_resources,json=podResources,proto3" json:"pod_resources,omitempty"`
  77. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  78. XXX_sizecache int32 `json:"-"`
  79. }
  80. func (m *ListPodResourcesResponse) Reset() { *m = ListPodResourcesResponse{} }
  81. func (*ListPodResourcesResponse) ProtoMessage() {}
  82. func (*ListPodResourcesResponse) Descriptor() ([]byte, []int) {
  83. return fileDescriptor_00212fb1f9d3bf1c, []int{1}
  84. }
  85. func (m *ListPodResourcesResponse) XXX_Unmarshal(b []byte) error {
  86. return m.Unmarshal(b)
  87. }
  88. func (m *ListPodResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  89. if deterministic {
  90. return xxx_messageInfo_ListPodResourcesResponse.Marshal(b, m, deterministic)
  91. } else {
  92. b = b[:cap(b)]
  93. n, err := m.MarshalToSizedBuffer(b)
  94. if err != nil {
  95. return nil, err
  96. }
  97. return b[:n], nil
  98. }
  99. }
  100. func (m *ListPodResourcesResponse) XXX_Merge(src proto.Message) {
  101. xxx_messageInfo_ListPodResourcesResponse.Merge(m, src)
  102. }
  103. func (m *ListPodResourcesResponse) XXX_Size() int {
  104. return m.Size()
  105. }
  106. func (m *ListPodResourcesResponse) XXX_DiscardUnknown() {
  107. xxx_messageInfo_ListPodResourcesResponse.DiscardUnknown(m)
  108. }
  109. var xxx_messageInfo_ListPodResourcesResponse proto.InternalMessageInfo
  110. func (m *ListPodResourcesResponse) GetPodResources() []*PodResources {
  111. if m != nil {
  112. return m.PodResources
  113. }
  114. return nil
  115. }
  116. // PodResources contains information about the node resources assigned to a pod
  117. type PodResources struct {
  118. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  119. Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
  120. Containers []*ContainerResources `protobuf:"bytes,3,rep,name=containers,proto3" json:"containers,omitempty"`
  121. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  122. XXX_sizecache int32 `json:"-"`
  123. }
  124. func (m *PodResources) Reset() { *m = PodResources{} }
  125. func (*PodResources) ProtoMessage() {}
  126. func (*PodResources) Descriptor() ([]byte, []int) {
  127. return fileDescriptor_00212fb1f9d3bf1c, []int{2}
  128. }
  129. func (m *PodResources) XXX_Unmarshal(b []byte) error {
  130. return m.Unmarshal(b)
  131. }
  132. func (m *PodResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  133. if deterministic {
  134. return xxx_messageInfo_PodResources.Marshal(b, m, deterministic)
  135. } else {
  136. b = b[:cap(b)]
  137. n, err := m.MarshalToSizedBuffer(b)
  138. if err != nil {
  139. return nil, err
  140. }
  141. return b[:n], nil
  142. }
  143. }
  144. func (m *PodResources) XXX_Merge(src proto.Message) {
  145. xxx_messageInfo_PodResources.Merge(m, src)
  146. }
  147. func (m *PodResources) XXX_Size() int {
  148. return m.Size()
  149. }
  150. func (m *PodResources) XXX_DiscardUnknown() {
  151. xxx_messageInfo_PodResources.DiscardUnknown(m)
  152. }
  153. var xxx_messageInfo_PodResources proto.InternalMessageInfo
  154. func (m *PodResources) GetName() string {
  155. if m != nil {
  156. return m.Name
  157. }
  158. return ""
  159. }
  160. func (m *PodResources) GetNamespace() string {
  161. if m != nil {
  162. return m.Namespace
  163. }
  164. return ""
  165. }
  166. func (m *PodResources) GetContainers() []*ContainerResources {
  167. if m != nil {
  168. return m.Containers
  169. }
  170. return nil
  171. }
  172. // ContainerResources contains information about the resources assigned to a container
  173. type ContainerResources struct {
  174. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  175. Devices []*ContainerDevices `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"`
  176. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  177. XXX_sizecache int32 `json:"-"`
  178. }
  179. func (m *ContainerResources) Reset() { *m = ContainerResources{} }
  180. func (*ContainerResources) ProtoMessage() {}
  181. func (*ContainerResources) Descriptor() ([]byte, []int) {
  182. return fileDescriptor_00212fb1f9d3bf1c, []int{3}
  183. }
  184. func (m *ContainerResources) XXX_Unmarshal(b []byte) error {
  185. return m.Unmarshal(b)
  186. }
  187. func (m *ContainerResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  188. if deterministic {
  189. return xxx_messageInfo_ContainerResources.Marshal(b, m, deterministic)
  190. } else {
  191. b = b[:cap(b)]
  192. n, err := m.MarshalToSizedBuffer(b)
  193. if err != nil {
  194. return nil, err
  195. }
  196. return b[:n], nil
  197. }
  198. }
  199. func (m *ContainerResources) XXX_Merge(src proto.Message) {
  200. xxx_messageInfo_ContainerResources.Merge(m, src)
  201. }
  202. func (m *ContainerResources) XXX_Size() int {
  203. return m.Size()
  204. }
  205. func (m *ContainerResources) XXX_DiscardUnknown() {
  206. xxx_messageInfo_ContainerResources.DiscardUnknown(m)
  207. }
  208. var xxx_messageInfo_ContainerResources proto.InternalMessageInfo
  209. func (m *ContainerResources) GetName() string {
  210. if m != nil {
  211. return m.Name
  212. }
  213. return ""
  214. }
  215. func (m *ContainerResources) GetDevices() []*ContainerDevices {
  216. if m != nil {
  217. return m.Devices
  218. }
  219. return nil
  220. }
  221. // ContainerDevices contains information about the devices assigned to a container
  222. type ContainerDevices struct {
  223. ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
  224. DeviceIds []string `protobuf:"bytes,2,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"`
  225. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  226. XXX_sizecache int32 `json:"-"`
  227. }
  228. func (m *ContainerDevices) Reset() { *m = ContainerDevices{} }
  229. func (*ContainerDevices) ProtoMessage() {}
  230. func (*ContainerDevices) Descriptor() ([]byte, []int) {
  231. return fileDescriptor_00212fb1f9d3bf1c, []int{4}
  232. }
  233. func (m *ContainerDevices) XXX_Unmarshal(b []byte) error {
  234. return m.Unmarshal(b)
  235. }
  236. func (m *ContainerDevices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  237. if deterministic {
  238. return xxx_messageInfo_ContainerDevices.Marshal(b, m, deterministic)
  239. } else {
  240. b = b[:cap(b)]
  241. n, err := m.MarshalToSizedBuffer(b)
  242. if err != nil {
  243. return nil, err
  244. }
  245. return b[:n], nil
  246. }
  247. }
  248. func (m *ContainerDevices) XXX_Merge(src proto.Message) {
  249. xxx_messageInfo_ContainerDevices.Merge(m, src)
  250. }
  251. func (m *ContainerDevices) XXX_Size() int {
  252. return m.Size()
  253. }
  254. func (m *ContainerDevices) XXX_DiscardUnknown() {
  255. xxx_messageInfo_ContainerDevices.DiscardUnknown(m)
  256. }
  257. var xxx_messageInfo_ContainerDevices proto.InternalMessageInfo
  258. func (m *ContainerDevices) GetResourceName() string {
  259. if m != nil {
  260. return m.ResourceName
  261. }
  262. return ""
  263. }
  264. func (m *ContainerDevices) GetDeviceIds() []string {
  265. if m != nil {
  266. return m.DeviceIds
  267. }
  268. return nil
  269. }
  270. func init() {
  271. proto.RegisterType((*ListPodResourcesRequest)(nil), "v1alpha1.ListPodResourcesRequest")
  272. proto.RegisterType((*ListPodResourcesResponse)(nil), "v1alpha1.ListPodResourcesResponse")
  273. proto.RegisterType((*PodResources)(nil), "v1alpha1.PodResources")
  274. proto.RegisterType((*ContainerResources)(nil), "v1alpha1.ContainerResources")
  275. proto.RegisterType((*ContainerDevices)(nil), "v1alpha1.ContainerDevices")
  276. }
  277. func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }
  278. var fileDescriptor_00212fb1f9d3bf1c = []byte{
  279. // 343 bytes of a gzipped FileDescriptorProto
  280. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xb1, 0x4e, 0xc3, 0x30,
  281. 0x10, 0xad, 0xdb, 0x0a, 0xc8, 0xd1, 0x4a, 0xc8, 0x03, 0x84, 0xaa, 0x58, 0xc5, 0x2c, 0x5d, 0x48,
  282. 0xd5, 0xc2, 0x06, 0x13, 0xb0, 0x20, 0x21, 0x40, 0x19, 0x60, 0xa3, 0x4a, 0x13, 0xd3, 0x46, 0xa2,
  283. 0xb1, 0x89, 0x93, 0x8e, 0x88, 0x4f, 0xe0, 0xb3, 0x3a, 0x32, 0x32, 0xd2, 0xf0, 0x23, 0x28, 0xb6,
  284. 0xac, 0x04, 0x5a, 0x98, 0x7c, 0x77, 0xef, 0x9d, 0xdf, 0xf3, 0x9d, 0xc1, 0xf2, 0x44, 0xe8, 0x88,
  285. 0x98, 0x27, 0x1c, 0x6f, 0xcc, 0xfa, 0xde, 0x93, 0x98, 0x78, 0xfd, 0xd6, 0xe1, 0x38, 0x4c, 0x26,
  286. 0xe9, 0xc8, 0xf1, 0xf9, 0xb4, 0x37, 0xe6, 0x63, 0xde, 0x53, 0x84, 0x51, 0xfa, 0xa8, 0x32, 0x95,
  287. 0xa8, 0x48, 0x37, 0xd2, 0x5d, 0xd8, 0xb9, 0x0a, 0x65, 0x72, 0xcb, 0x03, 0x97, 0x49, 0x9e, 0xc6,
  288. 0x3e, 0x93, 0x2e, 0x7b, 0x4e, 0x99, 0x4c, 0xe8, 0x3d, 0xd8, 0xcb, 0x90, 0x14, 0x3c, 0x92, 0x0c,
  289. 0x9f, 0x40, 0x53, 0xf0, 0x60, 0x18, 0x1b, 0xc0, 0x46, 0x9d, 0x5a, 0x77, 0x73, 0xb0, 0xed, 0x18,
  290. 0x1f, 0xce, 0x8f, 0xb6, 0x86, 0x28, 0x65, 0xf4, 0x05, 0x1a, 0x65, 0x14, 0x63, 0xa8, 0x47, 0xde,
  291. 0x94, 0xd9, 0xa8, 0x83, 0xba, 0x96, 0xab, 0x62, 0xdc, 0x06, 0x2b, 0x3f, 0xa5, 0xf0, 0x7c, 0x66,
  292. 0x57, 0x15, 0x50, 0x14, 0xf0, 0x29, 0x80, 0xcf, 0xa3, 0xc4, 0x0b, 0x23, 0x16, 0x4b, 0xbb, 0xa6,
  293. 0xb4, 0xdb, 0x85, 0xf6, 0xb9, 0xc1, 0x0a, 0x07, 0x25, 0x3e, 0x7d, 0x00, 0xbc, 0xcc, 0x58, 0xe9,
  294. 0xe2, 0x18, 0xd6, 0x03, 0x36, 0x0b, 0xf3, 0x07, 0x56, 0x95, 0x48, 0x6b, 0x85, 0xc8, 0x85, 0x66,
  295. 0xb8, 0x86, 0x4a, 0xef, 0x60, 0xeb, 0x37, 0x88, 0x0f, 0xa0, 0x69, 0x86, 0x35, 0x2c, 0xc9, 0x34,
  296. 0x4c, 0xf1, 0x3a, 0x97, 0xdb, 0x03, 0xd0, 0x77, 0x0c, 0xc3, 0x40, 0x2b, 0x5a, 0xae, 0xa5, 0x2b,
  297. 0x97, 0x81, 0x1c, 0x30, 0xc0, 0xe5, 0xb9, 0xe5, 0xcb, 0x61, 0x31, 0xbe, 0x81, 0x7a, 0x1e, 0xe1,
  298. 0xfd, 0xc2, 0xda, 0x1f, 0x1b, 0x6d, 0xd1, 0xff, 0x28, 0x7a, 0xb3, 0xb4, 0x72, 0xd6, 0x9e, 0x2f,
  299. 0x08, 0xfa, 0x58, 0x90, 0xca, 0x6b, 0x46, 0xd0, 0x3c, 0x23, 0xe8, 0x3d, 0x23, 0xe8, 0x33, 0x23,
  300. 0xe8, 0xed, 0x8b, 0x54, 0x46, 0x6b, 0xea, 0xdf, 0x1c, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc0,
  301. 0xce, 0xf2, 0x80, 0x7d, 0x02, 0x00, 0x00,
  302. }
  303. // Reference imports to suppress errors if they are not otherwise used.
  304. var _ context.Context
  305. var _ grpc.ClientConn
  306. // This is a compile-time assertion to ensure that this generated file
  307. // is compatible with the grpc package it is being compiled against.
  308. const _ = grpc.SupportPackageIsVersion4
  309. // PodResourcesListerClient is the client API for PodResourcesLister service.
  310. //
  311. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  312. type PodResourcesListerClient interface {
  313. List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error)
  314. }
  315. type podResourcesListerClient struct {
  316. cc *grpc.ClientConn
  317. }
  318. func NewPodResourcesListerClient(cc *grpc.ClientConn) PodResourcesListerClient {
  319. return &podResourcesListerClient{cc}
  320. }
  321. func (c *podResourcesListerClient) List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error) {
  322. out := new(ListPodResourcesResponse)
  323. err := c.cc.Invoke(ctx, "/v1alpha1.PodResourcesLister/List", in, out, opts...)
  324. if err != nil {
  325. return nil, err
  326. }
  327. return out, nil
  328. }
  329. // PodResourcesListerServer is the server API for PodResourcesLister service.
  330. type PodResourcesListerServer interface {
  331. List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error)
  332. }
  333. // UnimplementedPodResourcesListerServer can be embedded to have forward compatible implementations.
  334. type UnimplementedPodResourcesListerServer struct {
  335. }
  336. func (*UnimplementedPodResourcesListerServer) List(ctx context.Context, req *ListPodResourcesRequest) (*ListPodResourcesResponse, error) {
  337. return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
  338. }
  339. func RegisterPodResourcesListerServer(s *grpc.Server, srv PodResourcesListerServer) {
  340. s.RegisterService(&_PodResourcesLister_serviceDesc, srv)
  341. }
  342. func _PodResourcesLister_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  343. in := new(ListPodResourcesRequest)
  344. if err := dec(in); err != nil {
  345. return nil, err
  346. }
  347. if interceptor == nil {
  348. return srv.(PodResourcesListerServer).List(ctx, in)
  349. }
  350. info := &grpc.UnaryServerInfo{
  351. Server: srv,
  352. FullMethod: "/v1alpha1.PodResourcesLister/List",
  353. }
  354. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  355. return srv.(PodResourcesListerServer).List(ctx, req.(*ListPodResourcesRequest))
  356. }
  357. return interceptor(ctx, in, info, handler)
  358. }
  359. var _PodResourcesLister_serviceDesc = grpc.ServiceDesc{
  360. ServiceName: "v1alpha1.PodResourcesLister",
  361. HandlerType: (*PodResourcesListerServer)(nil),
  362. Methods: []grpc.MethodDesc{
  363. {
  364. MethodName: "List",
  365. Handler: _PodResourcesLister_List_Handler,
  366. },
  367. },
  368. Streams: []grpc.StreamDesc{},
  369. Metadata: "api.proto",
  370. }
  371. func (m *ListPodResourcesRequest) Marshal() (dAtA []byte, err error) {
  372. size := m.Size()
  373. dAtA = make([]byte, size)
  374. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  375. if err != nil {
  376. return nil, err
  377. }
  378. return dAtA[:n], nil
  379. }
  380. func (m *ListPodResourcesRequest) MarshalTo(dAtA []byte) (int, error) {
  381. size := m.Size()
  382. return m.MarshalToSizedBuffer(dAtA[:size])
  383. }
  384. func (m *ListPodResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  385. i := len(dAtA)
  386. _ = i
  387. var l int
  388. _ = l
  389. return len(dAtA) - i, nil
  390. }
  391. func (m *ListPodResourcesResponse) Marshal() (dAtA []byte, err error) {
  392. size := m.Size()
  393. dAtA = make([]byte, size)
  394. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  395. if err != nil {
  396. return nil, err
  397. }
  398. return dAtA[:n], nil
  399. }
  400. func (m *ListPodResourcesResponse) MarshalTo(dAtA []byte) (int, error) {
  401. size := m.Size()
  402. return m.MarshalToSizedBuffer(dAtA[:size])
  403. }
  404. func (m *ListPodResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  405. i := len(dAtA)
  406. _ = i
  407. var l int
  408. _ = l
  409. if len(m.PodResources) > 0 {
  410. for iNdEx := len(m.PodResources) - 1; iNdEx >= 0; iNdEx-- {
  411. {
  412. size, err := m.PodResources[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  413. if err != nil {
  414. return 0, err
  415. }
  416. i -= size
  417. i = encodeVarintApi(dAtA, i, uint64(size))
  418. }
  419. i--
  420. dAtA[i] = 0xa
  421. }
  422. }
  423. return len(dAtA) - i, nil
  424. }
  425. func (m *PodResources) Marshal() (dAtA []byte, err error) {
  426. size := m.Size()
  427. dAtA = make([]byte, size)
  428. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  429. if err != nil {
  430. return nil, err
  431. }
  432. return dAtA[:n], nil
  433. }
  434. func (m *PodResources) MarshalTo(dAtA []byte) (int, error) {
  435. size := m.Size()
  436. return m.MarshalToSizedBuffer(dAtA[:size])
  437. }
  438. func (m *PodResources) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  439. i := len(dAtA)
  440. _ = i
  441. var l int
  442. _ = l
  443. if len(m.Containers) > 0 {
  444. for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- {
  445. {
  446. size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  447. if err != nil {
  448. return 0, err
  449. }
  450. i -= size
  451. i = encodeVarintApi(dAtA, i, uint64(size))
  452. }
  453. i--
  454. dAtA[i] = 0x1a
  455. }
  456. }
  457. if len(m.Namespace) > 0 {
  458. i -= len(m.Namespace)
  459. copy(dAtA[i:], m.Namespace)
  460. i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace)))
  461. i--
  462. dAtA[i] = 0x12
  463. }
  464. if len(m.Name) > 0 {
  465. i -= len(m.Name)
  466. copy(dAtA[i:], m.Name)
  467. i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
  468. i--
  469. dAtA[i] = 0xa
  470. }
  471. return len(dAtA) - i, nil
  472. }
  473. func (m *ContainerResources) Marshal() (dAtA []byte, err error) {
  474. size := m.Size()
  475. dAtA = make([]byte, size)
  476. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  477. if err != nil {
  478. return nil, err
  479. }
  480. return dAtA[:n], nil
  481. }
  482. func (m *ContainerResources) MarshalTo(dAtA []byte) (int, error) {
  483. size := m.Size()
  484. return m.MarshalToSizedBuffer(dAtA[:size])
  485. }
  486. func (m *ContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  487. i := len(dAtA)
  488. _ = i
  489. var l int
  490. _ = l
  491. if len(m.Devices) > 0 {
  492. for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- {
  493. {
  494. size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  495. if err != nil {
  496. return 0, err
  497. }
  498. i -= size
  499. i = encodeVarintApi(dAtA, i, uint64(size))
  500. }
  501. i--
  502. dAtA[i] = 0x12
  503. }
  504. }
  505. if len(m.Name) > 0 {
  506. i -= len(m.Name)
  507. copy(dAtA[i:], m.Name)
  508. i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
  509. i--
  510. dAtA[i] = 0xa
  511. }
  512. return len(dAtA) - i, nil
  513. }
  514. func (m *ContainerDevices) Marshal() (dAtA []byte, err error) {
  515. size := m.Size()
  516. dAtA = make([]byte, size)
  517. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  518. if err != nil {
  519. return nil, err
  520. }
  521. return dAtA[:n], nil
  522. }
  523. func (m *ContainerDevices) MarshalTo(dAtA []byte) (int, error) {
  524. size := m.Size()
  525. return m.MarshalToSizedBuffer(dAtA[:size])
  526. }
  527. func (m *ContainerDevices) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  528. i := len(dAtA)
  529. _ = i
  530. var l int
  531. _ = l
  532. if len(m.DeviceIds) > 0 {
  533. for iNdEx := len(m.DeviceIds) - 1; iNdEx >= 0; iNdEx-- {
  534. i -= len(m.DeviceIds[iNdEx])
  535. copy(dAtA[i:], m.DeviceIds[iNdEx])
  536. i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceIds[iNdEx])))
  537. i--
  538. dAtA[i] = 0x12
  539. }
  540. }
  541. if len(m.ResourceName) > 0 {
  542. i -= len(m.ResourceName)
  543. copy(dAtA[i:], m.ResourceName)
  544. i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceName)))
  545. i--
  546. dAtA[i] = 0xa
  547. }
  548. return len(dAtA) - i, nil
  549. }
  550. func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
  551. offset -= sovApi(v)
  552. base := offset
  553. for v >= 1<<7 {
  554. dAtA[offset] = uint8(v&0x7f | 0x80)
  555. v >>= 7
  556. offset++
  557. }
  558. dAtA[offset] = uint8(v)
  559. return base
  560. }
  561. func (m *ListPodResourcesRequest) Size() (n int) {
  562. if m == nil {
  563. return 0
  564. }
  565. var l int
  566. _ = l
  567. return n
  568. }
  569. func (m *ListPodResourcesResponse) Size() (n int) {
  570. if m == nil {
  571. return 0
  572. }
  573. var l int
  574. _ = l
  575. if len(m.PodResources) > 0 {
  576. for _, e := range m.PodResources {
  577. l = e.Size()
  578. n += 1 + l + sovApi(uint64(l))
  579. }
  580. }
  581. return n
  582. }
  583. func (m *PodResources) Size() (n int) {
  584. if m == nil {
  585. return 0
  586. }
  587. var l int
  588. _ = l
  589. l = len(m.Name)
  590. if l > 0 {
  591. n += 1 + l + sovApi(uint64(l))
  592. }
  593. l = len(m.Namespace)
  594. if l > 0 {
  595. n += 1 + l + sovApi(uint64(l))
  596. }
  597. if len(m.Containers) > 0 {
  598. for _, e := range m.Containers {
  599. l = e.Size()
  600. n += 1 + l + sovApi(uint64(l))
  601. }
  602. }
  603. return n
  604. }
  605. func (m *ContainerResources) Size() (n int) {
  606. if m == nil {
  607. return 0
  608. }
  609. var l int
  610. _ = l
  611. l = len(m.Name)
  612. if l > 0 {
  613. n += 1 + l + sovApi(uint64(l))
  614. }
  615. if len(m.Devices) > 0 {
  616. for _, e := range m.Devices {
  617. l = e.Size()
  618. n += 1 + l + sovApi(uint64(l))
  619. }
  620. }
  621. return n
  622. }
  623. func (m *ContainerDevices) Size() (n int) {
  624. if m == nil {
  625. return 0
  626. }
  627. var l int
  628. _ = l
  629. l = len(m.ResourceName)
  630. if l > 0 {
  631. n += 1 + l + sovApi(uint64(l))
  632. }
  633. if len(m.DeviceIds) > 0 {
  634. for _, s := range m.DeviceIds {
  635. l = len(s)
  636. n += 1 + l + sovApi(uint64(l))
  637. }
  638. }
  639. return n
  640. }
  641. func sovApi(x uint64) (n int) {
  642. return (math_bits.Len64(x|1) + 6) / 7
  643. }
  644. func sozApi(x uint64) (n int) {
  645. return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  646. }
  647. func (this *ListPodResourcesRequest) String() string {
  648. if this == nil {
  649. return "nil"
  650. }
  651. s := strings.Join([]string{`&ListPodResourcesRequest{`,
  652. `}`,
  653. }, "")
  654. return s
  655. }
  656. func (this *ListPodResourcesResponse) String() string {
  657. if this == nil {
  658. return "nil"
  659. }
  660. repeatedStringForPodResources := "[]*PodResources{"
  661. for _, f := range this.PodResources {
  662. repeatedStringForPodResources += strings.Replace(f.String(), "PodResources", "PodResources", 1) + ","
  663. }
  664. repeatedStringForPodResources += "}"
  665. s := strings.Join([]string{`&ListPodResourcesResponse{`,
  666. `PodResources:` + repeatedStringForPodResources + `,`,
  667. `}`,
  668. }, "")
  669. return s
  670. }
  671. func (this *PodResources) String() string {
  672. if this == nil {
  673. return "nil"
  674. }
  675. repeatedStringForContainers := "[]*ContainerResources{"
  676. for _, f := range this.Containers {
  677. repeatedStringForContainers += strings.Replace(f.String(), "ContainerResources", "ContainerResources", 1) + ","
  678. }
  679. repeatedStringForContainers += "}"
  680. s := strings.Join([]string{`&PodResources{`,
  681. `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
  682. `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
  683. `Containers:` + repeatedStringForContainers + `,`,
  684. `}`,
  685. }, "")
  686. return s
  687. }
  688. func (this *ContainerResources) String() string {
  689. if this == nil {
  690. return "nil"
  691. }
  692. repeatedStringForDevices := "[]*ContainerDevices{"
  693. for _, f := range this.Devices {
  694. repeatedStringForDevices += strings.Replace(f.String(), "ContainerDevices", "ContainerDevices", 1) + ","
  695. }
  696. repeatedStringForDevices += "}"
  697. s := strings.Join([]string{`&ContainerResources{`,
  698. `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
  699. `Devices:` + repeatedStringForDevices + `,`,
  700. `}`,
  701. }, "")
  702. return s
  703. }
  704. func (this *ContainerDevices) String() string {
  705. if this == nil {
  706. return "nil"
  707. }
  708. s := strings.Join([]string{`&ContainerDevices{`,
  709. `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`,
  710. `DeviceIds:` + fmt.Sprintf("%v", this.DeviceIds) + `,`,
  711. `}`,
  712. }, "")
  713. return s
  714. }
  715. func valueToStringApi(v interface{}) string {
  716. rv := reflect.ValueOf(v)
  717. if rv.IsNil() {
  718. return "nil"
  719. }
  720. pv := reflect.Indirect(rv).Interface()
  721. return fmt.Sprintf("*%v", pv)
  722. }
  723. func (m *ListPodResourcesRequest) Unmarshal(dAtA []byte) error {
  724. l := len(dAtA)
  725. iNdEx := 0
  726. for iNdEx < l {
  727. preIndex := iNdEx
  728. var wire uint64
  729. for shift := uint(0); ; shift += 7 {
  730. if shift >= 64 {
  731. return ErrIntOverflowApi
  732. }
  733. if iNdEx >= l {
  734. return io.ErrUnexpectedEOF
  735. }
  736. b := dAtA[iNdEx]
  737. iNdEx++
  738. wire |= uint64(b&0x7F) << shift
  739. if b < 0x80 {
  740. break
  741. }
  742. }
  743. fieldNum := int32(wire >> 3)
  744. wireType := int(wire & 0x7)
  745. if wireType == 4 {
  746. return fmt.Errorf("proto: ListPodResourcesRequest: wiretype end group for non-group")
  747. }
  748. if fieldNum <= 0 {
  749. return fmt.Errorf("proto: ListPodResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  750. }
  751. switch fieldNum {
  752. default:
  753. iNdEx = preIndex
  754. skippy, err := skipApi(dAtA[iNdEx:])
  755. if err != nil {
  756. return err
  757. }
  758. if skippy < 0 {
  759. return ErrInvalidLengthApi
  760. }
  761. if (iNdEx + skippy) < 0 {
  762. return ErrInvalidLengthApi
  763. }
  764. if (iNdEx + skippy) > l {
  765. return io.ErrUnexpectedEOF
  766. }
  767. iNdEx += skippy
  768. }
  769. }
  770. if iNdEx > l {
  771. return io.ErrUnexpectedEOF
  772. }
  773. return nil
  774. }
  775. func (m *ListPodResourcesResponse) Unmarshal(dAtA []byte) error {
  776. l := len(dAtA)
  777. iNdEx := 0
  778. for iNdEx < l {
  779. preIndex := iNdEx
  780. var wire uint64
  781. for shift := uint(0); ; shift += 7 {
  782. if shift >= 64 {
  783. return ErrIntOverflowApi
  784. }
  785. if iNdEx >= l {
  786. return io.ErrUnexpectedEOF
  787. }
  788. b := dAtA[iNdEx]
  789. iNdEx++
  790. wire |= uint64(b&0x7F) << shift
  791. if b < 0x80 {
  792. break
  793. }
  794. }
  795. fieldNum := int32(wire >> 3)
  796. wireType := int(wire & 0x7)
  797. if wireType == 4 {
  798. return fmt.Errorf("proto: ListPodResourcesResponse: wiretype end group for non-group")
  799. }
  800. if fieldNum <= 0 {
  801. return fmt.Errorf("proto: ListPodResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  802. }
  803. switch fieldNum {
  804. case 1:
  805. if wireType != 2 {
  806. return fmt.Errorf("proto: wrong wireType = %d for field PodResources", wireType)
  807. }
  808. var msglen int
  809. for shift := uint(0); ; shift += 7 {
  810. if shift >= 64 {
  811. return ErrIntOverflowApi
  812. }
  813. if iNdEx >= l {
  814. return io.ErrUnexpectedEOF
  815. }
  816. b := dAtA[iNdEx]
  817. iNdEx++
  818. msglen |= int(b&0x7F) << shift
  819. if b < 0x80 {
  820. break
  821. }
  822. }
  823. if msglen < 0 {
  824. return ErrInvalidLengthApi
  825. }
  826. postIndex := iNdEx + msglen
  827. if postIndex < 0 {
  828. return ErrInvalidLengthApi
  829. }
  830. if postIndex > l {
  831. return io.ErrUnexpectedEOF
  832. }
  833. m.PodResources = append(m.PodResources, &PodResources{})
  834. if err := m.PodResources[len(m.PodResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  835. return err
  836. }
  837. iNdEx = postIndex
  838. default:
  839. iNdEx = preIndex
  840. skippy, err := skipApi(dAtA[iNdEx:])
  841. if err != nil {
  842. return err
  843. }
  844. if skippy < 0 {
  845. return ErrInvalidLengthApi
  846. }
  847. if (iNdEx + skippy) < 0 {
  848. return ErrInvalidLengthApi
  849. }
  850. if (iNdEx + skippy) > l {
  851. return io.ErrUnexpectedEOF
  852. }
  853. iNdEx += skippy
  854. }
  855. }
  856. if iNdEx > l {
  857. return io.ErrUnexpectedEOF
  858. }
  859. return nil
  860. }
  861. func (m *PodResources) Unmarshal(dAtA []byte) error {
  862. l := len(dAtA)
  863. iNdEx := 0
  864. for iNdEx < l {
  865. preIndex := iNdEx
  866. var wire uint64
  867. for shift := uint(0); ; shift += 7 {
  868. if shift >= 64 {
  869. return ErrIntOverflowApi
  870. }
  871. if iNdEx >= l {
  872. return io.ErrUnexpectedEOF
  873. }
  874. b := dAtA[iNdEx]
  875. iNdEx++
  876. wire |= uint64(b&0x7F) << shift
  877. if b < 0x80 {
  878. break
  879. }
  880. }
  881. fieldNum := int32(wire >> 3)
  882. wireType := int(wire & 0x7)
  883. if wireType == 4 {
  884. return fmt.Errorf("proto: PodResources: wiretype end group for non-group")
  885. }
  886. if fieldNum <= 0 {
  887. return fmt.Errorf("proto: PodResources: illegal tag %d (wire type %d)", fieldNum, wire)
  888. }
  889. switch fieldNum {
  890. case 1:
  891. if wireType != 2 {
  892. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  893. }
  894. var stringLen uint64
  895. for shift := uint(0); ; shift += 7 {
  896. if shift >= 64 {
  897. return ErrIntOverflowApi
  898. }
  899. if iNdEx >= l {
  900. return io.ErrUnexpectedEOF
  901. }
  902. b := dAtA[iNdEx]
  903. iNdEx++
  904. stringLen |= uint64(b&0x7F) << shift
  905. if b < 0x80 {
  906. break
  907. }
  908. }
  909. intStringLen := int(stringLen)
  910. if intStringLen < 0 {
  911. return ErrInvalidLengthApi
  912. }
  913. postIndex := iNdEx + intStringLen
  914. if postIndex < 0 {
  915. return ErrInvalidLengthApi
  916. }
  917. if postIndex > l {
  918. return io.ErrUnexpectedEOF
  919. }
  920. m.Name = string(dAtA[iNdEx:postIndex])
  921. iNdEx = postIndex
  922. case 2:
  923. if wireType != 2 {
  924. return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
  925. }
  926. var stringLen uint64
  927. for shift := uint(0); ; shift += 7 {
  928. if shift >= 64 {
  929. return ErrIntOverflowApi
  930. }
  931. if iNdEx >= l {
  932. return io.ErrUnexpectedEOF
  933. }
  934. b := dAtA[iNdEx]
  935. iNdEx++
  936. stringLen |= uint64(b&0x7F) << shift
  937. if b < 0x80 {
  938. break
  939. }
  940. }
  941. intStringLen := int(stringLen)
  942. if intStringLen < 0 {
  943. return ErrInvalidLengthApi
  944. }
  945. postIndex := iNdEx + intStringLen
  946. if postIndex < 0 {
  947. return ErrInvalidLengthApi
  948. }
  949. if postIndex > l {
  950. return io.ErrUnexpectedEOF
  951. }
  952. m.Namespace = string(dAtA[iNdEx:postIndex])
  953. iNdEx = postIndex
  954. case 3:
  955. if wireType != 2 {
  956. return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType)
  957. }
  958. var msglen int
  959. for shift := uint(0); ; shift += 7 {
  960. if shift >= 64 {
  961. return ErrIntOverflowApi
  962. }
  963. if iNdEx >= l {
  964. return io.ErrUnexpectedEOF
  965. }
  966. b := dAtA[iNdEx]
  967. iNdEx++
  968. msglen |= int(b&0x7F) << shift
  969. if b < 0x80 {
  970. break
  971. }
  972. }
  973. if msglen < 0 {
  974. return ErrInvalidLengthApi
  975. }
  976. postIndex := iNdEx + msglen
  977. if postIndex < 0 {
  978. return ErrInvalidLengthApi
  979. }
  980. if postIndex > l {
  981. return io.ErrUnexpectedEOF
  982. }
  983. m.Containers = append(m.Containers, &ContainerResources{})
  984. if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  985. return err
  986. }
  987. iNdEx = postIndex
  988. default:
  989. iNdEx = preIndex
  990. skippy, err := skipApi(dAtA[iNdEx:])
  991. if err != nil {
  992. return err
  993. }
  994. if skippy < 0 {
  995. return ErrInvalidLengthApi
  996. }
  997. if (iNdEx + skippy) < 0 {
  998. return ErrInvalidLengthApi
  999. }
  1000. if (iNdEx + skippy) > l {
  1001. return io.ErrUnexpectedEOF
  1002. }
  1003. iNdEx += skippy
  1004. }
  1005. }
  1006. if iNdEx > l {
  1007. return io.ErrUnexpectedEOF
  1008. }
  1009. return nil
  1010. }
  1011. func (m *ContainerResources) Unmarshal(dAtA []byte) error {
  1012. l := len(dAtA)
  1013. iNdEx := 0
  1014. for iNdEx < l {
  1015. preIndex := iNdEx
  1016. var wire uint64
  1017. for shift := uint(0); ; shift += 7 {
  1018. if shift >= 64 {
  1019. return ErrIntOverflowApi
  1020. }
  1021. if iNdEx >= l {
  1022. return io.ErrUnexpectedEOF
  1023. }
  1024. b := dAtA[iNdEx]
  1025. iNdEx++
  1026. wire |= uint64(b&0x7F) << shift
  1027. if b < 0x80 {
  1028. break
  1029. }
  1030. }
  1031. fieldNum := int32(wire >> 3)
  1032. wireType := int(wire & 0x7)
  1033. if wireType == 4 {
  1034. return fmt.Errorf("proto: ContainerResources: wiretype end group for non-group")
  1035. }
  1036. if fieldNum <= 0 {
  1037. return fmt.Errorf("proto: ContainerResources: illegal tag %d (wire type %d)", fieldNum, wire)
  1038. }
  1039. switch fieldNum {
  1040. case 1:
  1041. if wireType != 2 {
  1042. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  1043. }
  1044. var stringLen uint64
  1045. for shift := uint(0); ; shift += 7 {
  1046. if shift >= 64 {
  1047. return ErrIntOverflowApi
  1048. }
  1049. if iNdEx >= l {
  1050. return io.ErrUnexpectedEOF
  1051. }
  1052. b := dAtA[iNdEx]
  1053. iNdEx++
  1054. stringLen |= uint64(b&0x7F) << shift
  1055. if b < 0x80 {
  1056. break
  1057. }
  1058. }
  1059. intStringLen := int(stringLen)
  1060. if intStringLen < 0 {
  1061. return ErrInvalidLengthApi
  1062. }
  1063. postIndex := iNdEx + intStringLen
  1064. if postIndex < 0 {
  1065. return ErrInvalidLengthApi
  1066. }
  1067. if postIndex > l {
  1068. return io.ErrUnexpectedEOF
  1069. }
  1070. m.Name = string(dAtA[iNdEx:postIndex])
  1071. iNdEx = postIndex
  1072. case 2:
  1073. if wireType != 2 {
  1074. return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType)
  1075. }
  1076. var msglen int
  1077. for shift := uint(0); ; shift += 7 {
  1078. if shift >= 64 {
  1079. return ErrIntOverflowApi
  1080. }
  1081. if iNdEx >= l {
  1082. return io.ErrUnexpectedEOF
  1083. }
  1084. b := dAtA[iNdEx]
  1085. iNdEx++
  1086. msglen |= int(b&0x7F) << shift
  1087. if b < 0x80 {
  1088. break
  1089. }
  1090. }
  1091. if msglen < 0 {
  1092. return ErrInvalidLengthApi
  1093. }
  1094. postIndex := iNdEx + msglen
  1095. if postIndex < 0 {
  1096. return ErrInvalidLengthApi
  1097. }
  1098. if postIndex > l {
  1099. return io.ErrUnexpectedEOF
  1100. }
  1101. m.Devices = append(m.Devices, &ContainerDevices{})
  1102. if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1103. return err
  1104. }
  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) < 0 {
  1116. return ErrInvalidLengthApi
  1117. }
  1118. if (iNdEx + skippy) > l {
  1119. return io.ErrUnexpectedEOF
  1120. }
  1121. iNdEx += skippy
  1122. }
  1123. }
  1124. if iNdEx > l {
  1125. return io.ErrUnexpectedEOF
  1126. }
  1127. return nil
  1128. }
  1129. func (m *ContainerDevices) Unmarshal(dAtA []byte) error {
  1130. l := len(dAtA)
  1131. iNdEx := 0
  1132. for iNdEx < l {
  1133. preIndex := iNdEx
  1134. var wire uint64
  1135. for shift := uint(0); ; shift += 7 {
  1136. if shift >= 64 {
  1137. return ErrIntOverflowApi
  1138. }
  1139. if iNdEx >= l {
  1140. return io.ErrUnexpectedEOF
  1141. }
  1142. b := dAtA[iNdEx]
  1143. iNdEx++
  1144. wire |= uint64(b&0x7F) << shift
  1145. if b < 0x80 {
  1146. break
  1147. }
  1148. }
  1149. fieldNum := int32(wire >> 3)
  1150. wireType := int(wire & 0x7)
  1151. if wireType == 4 {
  1152. return fmt.Errorf("proto: ContainerDevices: wiretype end group for non-group")
  1153. }
  1154. if fieldNum <= 0 {
  1155. return fmt.Errorf("proto: ContainerDevices: illegal tag %d (wire type %d)", fieldNum, wire)
  1156. }
  1157. switch fieldNum {
  1158. case 1:
  1159. if wireType != 2 {
  1160. return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType)
  1161. }
  1162. var stringLen uint64
  1163. for shift := uint(0); ; shift += 7 {
  1164. if shift >= 64 {
  1165. return ErrIntOverflowApi
  1166. }
  1167. if iNdEx >= l {
  1168. return io.ErrUnexpectedEOF
  1169. }
  1170. b := dAtA[iNdEx]
  1171. iNdEx++
  1172. stringLen |= uint64(b&0x7F) << shift
  1173. if b < 0x80 {
  1174. break
  1175. }
  1176. }
  1177. intStringLen := int(stringLen)
  1178. if intStringLen < 0 {
  1179. return ErrInvalidLengthApi
  1180. }
  1181. postIndex := iNdEx + intStringLen
  1182. if postIndex < 0 {
  1183. return ErrInvalidLengthApi
  1184. }
  1185. if postIndex > l {
  1186. return io.ErrUnexpectedEOF
  1187. }
  1188. m.ResourceName = string(dAtA[iNdEx:postIndex])
  1189. iNdEx = postIndex
  1190. case 2:
  1191. if wireType != 2 {
  1192. return fmt.Errorf("proto: wrong wireType = %d for field DeviceIds", wireType)
  1193. }
  1194. var stringLen uint64
  1195. for shift := uint(0); ; shift += 7 {
  1196. if shift >= 64 {
  1197. return ErrIntOverflowApi
  1198. }
  1199. if iNdEx >= l {
  1200. return io.ErrUnexpectedEOF
  1201. }
  1202. b := dAtA[iNdEx]
  1203. iNdEx++
  1204. stringLen |= uint64(b&0x7F) << shift
  1205. if b < 0x80 {
  1206. break
  1207. }
  1208. }
  1209. intStringLen := int(stringLen)
  1210. if intStringLen < 0 {
  1211. return ErrInvalidLengthApi
  1212. }
  1213. postIndex := iNdEx + intStringLen
  1214. if postIndex < 0 {
  1215. return ErrInvalidLengthApi
  1216. }
  1217. if postIndex > l {
  1218. return io.ErrUnexpectedEOF
  1219. }
  1220. m.DeviceIds = append(m.DeviceIds, string(dAtA[iNdEx:postIndex]))
  1221. iNdEx = postIndex
  1222. default:
  1223. iNdEx = preIndex
  1224. skippy, err := skipApi(dAtA[iNdEx:])
  1225. if err != nil {
  1226. return err
  1227. }
  1228. if skippy < 0 {
  1229. return ErrInvalidLengthApi
  1230. }
  1231. if (iNdEx + skippy) < 0 {
  1232. return ErrInvalidLengthApi
  1233. }
  1234. if (iNdEx + skippy) > l {
  1235. return io.ErrUnexpectedEOF
  1236. }
  1237. iNdEx += skippy
  1238. }
  1239. }
  1240. if iNdEx > l {
  1241. return io.ErrUnexpectedEOF
  1242. }
  1243. return nil
  1244. }
  1245. func skipApi(dAtA []byte) (n int, err error) {
  1246. l := len(dAtA)
  1247. iNdEx := 0
  1248. depth := 0
  1249. for iNdEx < l {
  1250. var wire uint64
  1251. for shift := uint(0); ; shift += 7 {
  1252. if shift >= 64 {
  1253. return 0, ErrIntOverflowApi
  1254. }
  1255. if iNdEx >= l {
  1256. return 0, io.ErrUnexpectedEOF
  1257. }
  1258. b := dAtA[iNdEx]
  1259. iNdEx++
  1260. wire |= (uint64(b) & 0x7F) << shift
  1261. if b < 0x80 {
  1262. break
  1263. }
  1264. }
  1265. wireType := int(wire & 0x7)
  1266. switch wireType {
  1267. case 0:
  1268. for shift := uint(0); ; shift += 7 {
  1269. if shift >= 64 {
  1270. return 0, ErrIntOverflowApi
  1271. }
  1272. if iNdEx >= l {
  1273. return 0, io.ErrUnexpectedEOF
  1274. }
  1275. iNdEx++
  1276. if dAtA[iNdEx-1] < 0x80 {
  1277. break
  1278. }
  1279. }
  1280. case 1:
  1281. iNdEx += 8
  1282. case 2:
  1283. var length int
  1284. for shift := uint(0); ; shift += 7 {
  1285. if shift >= 64 {
  1286. return 0, ErrIntOverflowApi
  1287. }
  1288. if iNdEx >= l {
  1289. return 0, io.ErrUnexpectedEOF
  1290. }
  1291. b := dAtA[iNdEx]
  1292. iNdEx++
  1293. length |= (int(b) & 0x7F) << shift
  1294. if b < 0x80 {
  1295. break
  1296. }
  1297. }
  1298. if length < 0 {
  1299. return 0, ErrInvalidLengthApi
  1300. }
  1301. iNdEx += length
  1302. case 3:
  1303. depth++
  1304. case 4:
  1305. if depth == 0 {
  1306. return 0, ErrUnexpectedEndOfGroupApi
  1307. }
  1308. depth--
  1309. case 5:
  1310. iNdEx += 4
  1311. default:
  1312. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1313. }
  1314. if iNdEx < 0 {
  1315. return 0, ErrInvalidLengthApi
  1316. }
  1317. if depth == 0 {
  1318. return iNdEx, nil
  1319. }
  1320. }
  1321. return 0, io.ErrUnexpectedEOF
  1322. }
  1323. var (
  1324. ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
  1325. ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
  1326. ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group")
  1327. )