api.pb.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  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 v1beta2
  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. // Renames a field from v1beta1 ExampleRequest.
  40. type ExampleRequest struct {
  41. Request string `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
  42. V1Beta2Field string `protobuf:"bytes,2,opt,name=v1beta2_field,json=v1beta2Field,proto3" json:"v1beta2_field,omitempty"`
  43. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  44. XXX_sizecache int32 `json:"-"`
  45. }
  46. func (m *ExampleRequest) Reset() { *m = ExampleRequest{} }
  47. func (*ExampleRequest) ProtoMessage() {}
  48. func (*ExampleRequest) Descriptor() ([]byte, []int) {
  49. return fileDescriptor_00212fb1f9d3bf1c, []int{0}
  50. }
  51. func (m *ExampleRequest) XXX_Unmarshal(b []byte) error {
  52. return m.Unmarshal(b)
  53. }
  54. func (m *ExampleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  55. if deterministic {
  56. return xxx_messageInfo_ExampleRequest.Marshal(b, m, deterministic)
  57. } else {
  58. b = b[:cap(b)]
  59. n, err := m.MarshalToSizedBuffer(b)
  60. if err != nil {
  61. return nil, err
  62. }
  63. return b[:n], nil
  64. }
  65. }
  66. func (m *ExampleRequest) XXX_Merge(src proto.Message) {
  67. xxx_messageInfo_ExampleRequest.Merge(m, src)
  68. }
  69. func (m *ExampleRequest) XXX_Size() int {
  70. return m.Size()
  71. }
  72. func (m *ExampleRequest) XXX_DiscardUnknown() {
  73. xxx_messageInfo_ExampleRequest.DiscardUnknown(m)
  74. }
  75. var xxx_messageInfo_ExampleRequest proto.InternalMessageInfo
  76. func (m *ExampleRequest) GetRequest() string {
  77. if m != nil {
  78. return m.Request
  79. }
  80. return ""
  81. }
  82. func (m *ExampleRequest) GetV1Beta2Field() string {
  83. if m != nil {
  84. return m.V1Beta2Field
  85. }
  86. return ""
  87. }
  88. type ExampleResponse struct {
  89. Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
  90. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  91. XXX_sizecache int32 `json:"-"`
  92. }
  93. func (m *ExampleResponse) Reset() { *m = ExampleResponse{} }
  94. func (*ExampleResponse) ProtoMessage() {}
  95. func (*ExampleResponse) Descriptor() ([]byte, []int) {
  96. return fileDescriptor_00212fb1f9d3bf1c, []int{1}
  97. }
  98. func (m *ExampleResponse) XXX_Unmarshal(b []byte) error {
  99. return m.Unmarshal(b)
  100. }
  101. func (m *ExampleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  102. if deterministic {
  103. return xxx_messageInfo_ExampleResponse.Marshal(b, m, deterministic)
  104. } else {
  105. b = b[:cap(b)]
  106. n, err := m.MarshalToSizedBuffer(b)
  107. if err != nil {
  108. return nil, err
  109. }
  110. return b[:n], nil
  111. }
  112. }
  113. func (m *ExampleResponse) XXX_Merge(src proto.Message) {
  114. xxx_messageInfo_ExampleResponse.Merge(m, src)
  115. }
  116. func (m *ExampleResponse) XXX_Size() int {
  117. return m.Size()
  118. }
  119. func (m *ExampleResponse) XXX_DiscardUnknown() {
  120. xxx_messageInfo_ExampleResponse.DiscardUnknown(m)
  121. }
  122. var xxx_messageInfo_ExampleResponse proto.InternalMessageInfo
  123. func (m *ExampleResponse) GetError() string {
  124. if m != nil {
  125. return m.Error
  126. }
  127. return ""
  128. }
  129. func init() {
  130. proto.RegisterType((*ExampleRequest)(nil), "v1beta2.ExampleRequest")
  131. proto.RegisterType((*ExampleResponse)(nil), "v1beta2.ExampleResponse")
  132. }
  133. func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }
  134. var fileDescriptor_00212fb1f9d3bf1c = []byte{
  135. // 227 bytes of a gzipped FileDescriptorProto
  136. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4,
  137. 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x92, 0xd2,
  138. 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7,
  139. 0x07, 0xcb, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xa7, 0xe4, 0xcf, 0xc5,
  140. 0xe7, 0x5a, 0x91, 0x98, 0x5b, 0x90, 0x93, 0x1a, 0x94, 0x5a, 0x58, 0x9a, 0x5a, 0x5c, 0x22, 0x24,
  141. 0xc1, 0xc5, 0x5e, 0x04, 0x61, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xb8, 0x42, 0xca,
  142. 0x5c, 0xbc, 0x50, 0x5b, 0xe2, 0xd3, 0x32, 0x53, 0x73, 0x52, 0x24, 0x98, 0xc0, 0xf2, 0x3c, 0x50,
  143. 0x41, 0x37, 0x90, 0x98, 0x92, 0x3a, 0x17, 0x3f, 0xdc, 0xc0, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54,
  144. 0x21, 0x11, 0x2e, 0xd6, 0xd4, 0xa2, 0xa2, 0xfc, 0x22, 0xa8, 0x79, 0x10, 0x8e, 0x51, 0x00, 0x17,
  145. 0x3b, 0x54, 0xa1, 0x90, 0x2b, 0x17, 0x9f, 0x7b, 0x6a, 0x09, 0x94, 0xe7, 0x99, 0x97, 0x96, 0x2f,
  146. 0x24, 0xae, 0x07, 0x35, 0x54, 0x0f, 0xd5, 0x75, 0x52, 0x12, 0x98, 0x12, 0x10, 0x5b, 0x94, 0x18,
  147. 0x9c, 0x64, 0x4e, 0x3c, 0x94, 0x63, 0xbc, 0xf1, 0x50, 0x8e, 0xa1, 0xe1, 0x91, 0x1c, 0xe3, 0x89,
  148. 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0x43,
  149. 0x12, 0x1b, 0xd8, 0xc3, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x79, 0x17, 0x13, 0x35,
  150. 0x01, 0x00, 0x00,
  151. }
  152. // Reference imports to suppress errors if they are not otherwise used.
  153. var _ context.Context
  154. var _ grpc.ClientConn
  155. // This is a compile-time assertion to ensure that this generated file
  156. // is compatible with the grpc package it is being compiled against.
  157. const _ = grpc.SupportPackageIsVersion4
  158. // ExampleClient is the client API for Example service.
  159. //
  160. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  161. type ExampleClient interface {
  162. GetExampleInfo(ctx context.Context, in *ExampleRequest, opts ...grpc.CallOption) (*ExampleResponse, error)
  163. }
  164. type exampleClient struct {
  165. cc *grpc.ClientConn
  166. }
  167. func NewExampleClient(cc *grpc.ClientConn) ExampleClient {
  168. return &exampleClient{cc}
  169. }
  170. func (c *exampleClient) GetExampleInfo(ctx context.Context, in *ExampleRequest, opts ...grpc.CallOption) (*ExampleResponse, error) {
  171. out := new(ExampleResponse)
  172. err := c.cc.Invoke(ctx, "/v1beta2.Example/GetExampleInfo", in, out, opts...)
  173. if err != nil {
  174. return nil, err
  175. }
  176. return out, nil
  177. }
  178. // ExampleServer is the server API for Example service.
  179. type ExampleServer interface {
  180. GetExampleInfo(context.Context, *ExampleRequest) (*ExampleResponse, error)
  181. }
  182. // UnimplementedExampleServer can be embedded to have forward compatible implementations.
  183. type UnimplementedExampleServer struct {
  184. }
  185. func (*UnimplementedExampleServer) GetExampleInfo(ctx context.Context, req *ExampleRequest) (*ExampleResponse, error) {
  186. return nil, status.Errorf(codes.Unimplemented, "method GetExampleInfo not implemented")
  187. }
  188. func RegisterExampleServer(s *grpc.Server, srv ExampleServer) {
  189. s.RegisterService(&_Example_serviceDesc, srv)
  190. }
  191. func _Example_GetExampleInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  192. in := new(ExampleRequest)
  193. if err := dec(in); err != nil {
  194. return nil, err
  195. }
  196. if interceptor == nil {
  197. return srv.(ExampleServer).GetExampleInfo(ctx, in)
  198. }
  199. info := &grpc.UnaryServerInfo{
  200. Server: srv,
  201. FullMethod: "/v1beta2.Example/GetExampleInfo",
  202. }
  203. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  204. return srv.(ExampleServer).GetExampleInfo(ctx, req.(*ExampleRequest))
  205. }
  206. return interceptor(ctx, in, info, handler)
  207. }
  208. var _Example_serviceDesc = grpc.ServiceDesc{
  209. ServiceName: "v1beta2.Example",
  210. HandlerType: (*ExampleServer)(nil),
  211. Methods: []grpc.MethodDesc{
  212. {
  213. MethodName: "GetExampleInfo",
  214. Handler: _Example_GetExampleInfo_Handler,
  215. },
  216. },
  217. Streams: []grpc.StreamDesc{},
  218. Metadata: "api.proto",
  219. }
  220. func (m *ExampleRequest) Marshal() (dAtA []byte, err error) {
  221. size := m.Size()
  222. dAtA = make([]byte, size)
  223. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  224. if err != nil {
  225. return nil, err
  226. }
  227. return dAtA[:n], nil
  228. }
  229. func (m *ExampleRequest) MarshalTo(dAtA []byte) (int, error) {
  230. size := m.Size()
  231. return m.MarshalToSizedBuffer(dAtA[:size])
  232. }
  233. func (m *ExampleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  234. i := len(dAtA)
  235. _ = i
  236. var l int
  237. _ = l
  238. if len(m.V1Beta2Field) > 0 {
  239. i -= len(m.V1Beta2Field)
  240. copy(dAtA[i:], m.V1Beta2Field)
  241. i = encodeVarintApi(dAtA, i, uint64(len(m.V1Beta2Field)))
  242. i--
  243. dAtA[i] = 0x12
  244. }
  245. if len(m.Request) > 0 {
  246. i -= len(m.Request)
  247. copy(dAtA[i:], m.Request)
  248. i = encodeVarintApi(dAtA, i, uint64(len(m.Request)))
  249. i--
  250. dAtA[i] = 0xa
  251. }
  252. return len(dAtA) - i, nil
  253. }
  254. func (m *ExampleResponse) Marshal() (dAtA []byte, err error) {
  255. size := m.Size()
  256. dAtA = make([]byte, size)
  257. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  258. if err != nil {
  259. return nil, err
  260. }
  261. return dAtA[:n], nil
  262. }
  263. func (m *ExampleResponse) MarshalTo(dAtA []byte) (int, error) {
  264. size := m.Size()
  265. return m.MarshalToSizedBuffer(dAtA[:size])
  266. }
  267. func (m *ExampleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  268. i := len(dAtA)
  269. _ = i
  270. var l int
  271. _ = l
  272. if len(m.Error) > 0 {
  273. i -= len(m.Error)
  274. copy(dAtA[i:], m.Error)
  275. i = encodeVarintApi(dAtA, i, uint64(len(m.Error)))
  276. i--
  277. dAtA[i] = 0xa
  278. }
  279. return len(dAtA) - i, nil
  280. }
  281. func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
  282. offset -= sovApi(v)
  283. base := offset
  284. for v >= 1<<7 {
  285. dAtA[offset] = uint8(v&0x7f | 0x80)
  286. v >>= 7
  287. offset++
  288. }
  289. dAtA[offset] = uint8(v)
  290. return base
  291. }
  292. func (m *ExampleRequest) Size() (n int) {
  293. if m == nil {
  294. return 0
  295. }
  296. var l int
  297. _ = l
  298. l = len(m.Request)
  299. if l > 0 {
  300. n += 1 + l + sovApi(uint64(l))
  301. }
  302. l = len(m.V1Beta2Field)
  303. if l > 0 {
  304. n += 1 + l + sovApi(uint64(l))
  305. }
  306. return n
  307. }
  308. func (m *ExampleResponse) Size() (n int) {
  309. if m == nil {
  310. return 0
  311. }
  312. var l int
  313. _ = l
  314. l = len(m.Error)
  315. if l > 0 {
  316. n += 1 + l + sovApi(uint64(l))
  317. }
  318. return n
  319. }
  320. func sovApi(x uint64) (n int) {
  321. return (math_bits.Len64(x|1) + 6) / 7
  322. }
  323. func sozApi(x uint64) (n int) {
  324. return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  325. }
  326. func (this *ExampleRequest) String() string {
  327. if this == nil {
  328. return "nil"
  329. }
  330. s := strings.Join([]string{`&ExampleRequest{`,
  331. `Request:` + fmt.Sprintf("%v", this.Request) + `,`,
  332. `V1Beta2Field:` + fmt.Sprintf("%v", this.V1Beta2Field) + `,`,
  333. `}`,
  334. }, "")
  335. return s
  336. }
  337. func (this *ExampleResponse) String() string {
  338. if this == nil {
  339. return "nil"
  340. }
  341. s := strings.Join([]string{`&ExampleResponse{`,
  342. `Error:` + fmt.Sprintf("%v", this.Error) + `,`,
  343. `}`,
  344. }, "")
  345. return s
  346. }
  347. func valueToStringApi(v interface{}) string {
  348. rv := reflect.ValueOf(v)
  349. if rv.IsNil() {
  350. return "nil"
  351. }
  352. pv := reflect.Indirect(rv).Interface()
  353. return fmt.Sprintf("*%v", pv)
  354. }
  355. func (m *ExampleRequest) Unmarshal(dAtA []byte) error {
  356. l := len(dAtA)
  357. iNdEx := 0
  358. for iNdEx < l {
  359. preIndex := iNdEx
  360. var wire uint64
  361. for shift := uint(0); ; shift += 7 {
  362. if shift >= 64 {
  363. return ErrIntOverflowApi
  364. }
  365. if iNdEx >= l {
  366. return io.ErrUnexpectedEOF
  367. }
  368. b := dAtA[iNdEx]
  369. iNdEx++
  370. wire |= uint64(b&0x7F) << shift
  371. if b < 0x80 {
  372. break
  373. }
  374. }
  375. fieldNum := int32(wire >> 3)
  376. wireType := int(wire & 0x7)
  377. if wireType == 4 {
  378. return fmt.Errorf("proto: ExampleRequest: wiretype end group for non-group")
  379. }
  380. if fieldNum <= 0 {
  381. return fmt.Errorf("proto: ExampleRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  382. }
  383. switch fieldNum {
  384. case 1:
  385. if wireType != 2 {
  386. return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType)
  387. }
  388. var stringLen uint64
  389. for shift := uint(0); ; shift += 7 {
  390. if shift >= 64 {
  391. return ErrIntOverflowApi
  392. }
  393. if iNdEx >= l {
  394. return io.ErrUnexpectedEOF
  395. }
  396. b := dAtA[iNdEx]
  397. iNdEx++
  398. stringLen |= uint64(b&0x7F) << shift
  399. if b < 0x80 {
  400. break
  401. }
  402. }
  403. intStringLen := int(stringLen)
  404. if intStringLen < 0 {
  405. return ErrInvalidLengthApi
  406. }
  407. postIndex := iNdEx + intStringLen
  408. if postIndex < 0 {
  409. return ErrInvalidLengthApi
  410. }
  411. if postIndex > l {
  412. return io.ErrUnexpectedEOF
  413. }
  414. m.Request = string(dAtA[iNdEx:postIndex])
  415. iNdEx = postIndex
  416. case 2:
  417. if wireType != 2 {
  418. return fmt.Errorf("proto: wrong wireType = %d for field V1Beta2Field", wireType)
  419. }
  420. var stringLen uint64
  421. for shift := uint(0); ; shift += 7 {
  422. if shift >= 64 {
  423. return ErrIntOverflowApi
  424. }
  425. if iNdEx >= l {
  426. return io.ErrUnexpectedEOF
  427. }
  428. b := dAtA[iNdEx]
  429. iNdEx++
  430. stringLen |= uint64(b&0x7F) << shift
  431. if b < 0x80 {
  432. break
  433. }
  434. }
  435. intStringLen := int(stringLen)
  436. if intStringLen < 0 {
  437. return ErrInvalidLengthApi
  438. }
  439. postIndex := iNdEx + intStringLen
  440. if postIndex < 0 {
  441. return ErrInvalidLengthApi
  442. }
  443. if postIndex > l {
  444. return io.ErrUnexpectedEOF
  445. }
  446. m.V1Beta2Field = string(dAtA[iNdEx:postIndex])
  447. iNdEx = postIndex
  448. default:
  449. iNdEx = preIndex
  450. skippy, err := skipApi(dAtA[iNdEx:])
  451. if err != nil {
  452. return err
  453. }
  454. if skippy < 0 {
  455. return ErrInvalidLengthApi
  456. }
  457. if (iNdEx + skippy) < 0 {
  458. return ErrInvalidLengthApi
  459. }
  460. if (iNdEx + skippy) > l {
  461. return io.ErrUnexpectedEOF
  462. }
  463. iNdEx += skippy
  464. }
  465. }
  466. if iNdEx > l {
  467. return io.ErrUnexpectedEOF
  468. }
  469. return nil
  470. }
  471. func (m *ExampleResponse) Unmarshal(dAtA []byte) error {
  472. l := len(dAtA)
  473. iNdEx := 0
  474. for iNdEx < l {
  475. preIndex := iNdEx
  476. var wire uint64
  477. for shift := uint(0); ; shift += 7 {
  478. if shift >= 64 {
  479. return ErrIntOverflowApi
  480. }
  481. if iNdEx >= l {
  482. return io.ErrUnexpectedEOF
  483. }
  484. b := dAtA[iNdEx]
  485. iNdEx++
  486. wire |= uint64(b&0x7F) << shift
  487. if b < 0x80 {
  488. break
  489. }
  490. }
  491. fieldNum := int32(wire >> 3)
  492. wireType := int(wire & 0x7)
  493. if wireType == 4 {
  494. return fmt.Errorf("proto: ExampleResponse: wiretype end group for non-group")
  495. }
  496. if fieldNum <= 0 {
  497. return fmt.Errorf("proto: ExampleResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  498. }
  499. switch fieldNum {
  500. case 1:
  501. if wireType != 2 {
  502. return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
  503. }
  504. var stringLen uint64
  505. for shift := uint(0); ; shift += 7 {
  506. if shift >= 64 {
  507. return ErrIntOverflowApi
  508. }
  509. if iNdEx >= l {
  510. return io.ErrUnexpectedEOF
  511. }
  512. b := dAtA[iNdEx]
  513. iNdEx++
  514. stringLen |= uint64(b&0x7F) << shift
  515. if b < 0x80 {
  516. break
  517. }
  518. }
  519. intStringLen := int(stringLen)
  520. if intStringLen < 0 {
  521. return ErrInvalidLengthApi
  522. }
  523. postIndex := iNdEx + intStringLen
  524. if postIndex < 0 {
  525. return ErrInvalidLengthApi
  526. }
  527. if postIndex > l {
  528. return io.ErrUnexpectedEOF
  529. }
  530. m.Error = string(dAtA[iNdEx:postIndex])
  531. iNdEx = postIndex
  532. default:
  533. iNdEx = preIndex
  534. skippy, err := skipApi(dAtA[iNdEx:])
  535. if err != nil {
  536. return err
  537. }
  538. if skippy < 0 {
  539. return ErrInvalidLengthApi
  540. }
  541. if (iNdEx + skippy) < 0 {
  542. return ErrInvalidLengthApi
  543. }
  544. if (iNdEx + skippy) > l {
  545. return io.ErrUnexpectedEOF
  546. }
  547. iNdEx += skippy
  548. }
  549. }
  550. if iNdEx > l {
  551. return io.ErrUnexpectedEOF
  552. }
  553. return nil
  554. }
  555. func skipApi(dAtA []byte) (n int, err error) {
  556. l := len(dAtA)
  557. iNdEx := 0
  558. depth := 0
  559. for iNdEx < l {
  560. var wire uint64
  561. for shift := uint(0); ; shift += 7 {
  562. if shift >= 64 {
  563. return 0, ErrIntOverflowApi
  564. }
  565. if iNdEx >= l {
  566. return 0, io.ErrUnexpectedEOF
  567. }
  568. b := dAtA[iNdEx]
  569. iNdEx++
  570. wire |= (uint64(b) & 0x7F) << shift
  571. if b < 0x80 {
  572. break
  573. }
  574. }
  575. wireType := int(wire & 0x7)
  576. switch wireType {
  577. case 0:
  578. for shift := uint(0); ; shift += 7 {
  579. if shift >= 64 {
  580. return 0, ErrIntOverflowApi
  581. }
  582. if iNdEx >= l {
  583. return 0, io.ErrUnexpectedEOF
  584. }
  585. iNdEx++
  586. if dAtA[iNdEx-1] < 0x80 {
  587. break
  588. }
  589. }
  590. case 1:
  591. iNdEx += 8
  592. case 2:
  593. var length int
  594. for shift := uint(0); ; shift += 7 {
  595. if shift >= 64 {
  596. return 0, ErrIntOverflowApi
  597. }
  598. if iNdEx >= l {
  599. return 0, io.ErrUnexpectedEOF
  600. }
  601. b := dAtA[iNdEx]
  602. iNdEx++
  603. length |= (int(b) & 0x7F) << shift
  604. if b < 0x80 {
  605. break
  606. }
  607. }
  608. if length < 0 {
  609. return 0, ErrInvalidLengthApi
  610. }
  611. iNdEx += length
  612. case 3:
  613. depth++
  614. case 4:
  615. if depth == 0 {
  616. return 0, ErrUnexpectedEndOfGroupApi
  617. }
  618. depth--
  619. case 5:
  620. iNdEx += 4
  621. default:
  622. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  623. }
  624. if iNdEx < 0 {
  625. return 0, ErrInvalidLengthApi
  626. }
  627. if depth == 0 {
  628. return iNdEx, nil
  629. }
  630. }
  631. return 0, io.ErrUnexpectedEOF
  632. }
  633. var (
  634. ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
  635. ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
  636. ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group")
  637. )