/vendor/github.com/gogo/protobuf/test/issue34/proto.pb.go

https://gitlab.com/unofficial-mirrors/openshift-origin · Go · 352 lines · 316 code · 17 blank · 19 comment · 74 complexity · 23e581e24f0e4f521c0f8085804855b4 MD5 · raw file

  1. // Code generated by protoc-gen-gogo.
  2. // source: proto.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package issue34 is a generated protocol buffer package.
  6. It is generated from these files:
  7. proto.proto
  8. It has these top-level messages:
  9. Foo
  10. FooWithRepeated
  11. */
  12. package issue34
  13. import proto "github.com/gogo/protobuf/proto"
  14. import fmt "fmt"
  15. import math "math"
  16. import _ "github.com/gogo/protobuf/gogoproto"
  17. import io "io"
  18. // Reference imports to suppress errors if they are not otherwise used.
  19. var _ = proto.Marshal
  20. var _ = fmt.Errorf
  21. var _ = math.Inf
  22. // This is a compile-time assertion to ensure that this generated file
  23. // is compatible with the proto package it is being compiled against.
  24. // A compilation error at this line likely means your copy of the
  25. // proto package needs to be updated.
  26. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  27. type Foo struct {
  28. Bar []byte `protobuf:"bytes,1,opt,name=bar" json:"bar,omitempty"`
  29. XXX_unrecognized []byte `json:"-"`
  30. }
  31. func (m *Foo) Reset() { *m = Foo{} }
  32. func (m *Foo) String() string { return proto.CompactTextString(m) }
  33. func (*Foo) ProtoMessage() {}
  34. func (*Foo) Descriptor() ([]byte, []int) { return fileDescriptorProto, []int{0} }
  35. func (m *Foo) GetBar() []byte {
  36. if m != nil {
  37. return m.Bar
  38. }
  39. return nil
  40. }
  41. type FooWithRepeated struct {
  42. Bar [][]byte `protobuf:"bytes,1,rep,name=bar" json:"bar,omitempty"`
  43. XXX_unrecognized []byte `json:"-"`
  44. }
  45. func (m *FooWithRepeated) Reset() { *m = FooWithRepeated{} }
  46. func (m *FooWithRepeated) String() string { return proto.CompactTextString(m) }
  47. func (*FooWithRepeated) ProtoMessage() {}
  48. func (*FooWithRepeated) Descriptor() ([]byte, []int) { return fileDescriptorProto, []int{1} }
  49. func (m *FooWithRepeated) GetBar() [][]byte {
  50. if m != nil {
  51. return m.Bar
  52. }
  53. return nil
  54. }
  55. func init() {
  56. proto.RegisterType((*Foo)(nil), "issue34.Foo")
  57. proto.RegisterType((*FooWithRepeated)(nil), "issue34.FooWithRepeated")
  58. }
  59. func (m *Foo) Unmarshal(dAtA []byte) error {
  60. l := len(dAtA)
  61. iNdEx := 0
  62. for iNdEx < l {
  63. preIndex := iNdEx
  64. var wire uint64
  65. for shift := uint(0); ; shift += 7 {
  66. if shift >= 64 {
  67. return ErrIntOverflowProto
  68. }
  69. if iNdEx >= l {
  70. return io.ErrUnexpectedEOF
  71. }
  72. b := dAtA[iNdEx]
  73. iNdEx++
  74. wire |= (uint64(b) & 0x7F) << shift
  75. if b < 0x80 {
  76. break
  77. }
  78. }
  79. fieldNum := int32(wire >> 3)
  80. wireType := int(wire & 0x7)
  81. if wireType == 4 {
  82. return fmt.Errorf("proto: Foo: wiretype end group for non-group")
  83. }
  84. if fieldNum <= 0 {
  85. return fmt.Errorf("proto: Foo: illegal tag %d (wire type %d)", fieldNum, wire)
  86. }
  87. switch fieldNum {
  88. case 1:
  89. if wireType != 2 {
  90. return fmt.Errorf("proto: wrong wireType = %d for field Bar", wireType)
  91. }
  92. var byteLen int
  93. for shift := uint(0); ; shift += 7 {
  94. if shift >= 64 {
  95. return ErrIntOverflowProto
  96. }
  97. if iNdEx >= l {
  98. return io.ErrUnexpectedEOF
  99. }
  100. b := dAtA[iNdEx]
  101. iNdEx++
  102. byteLen |= (int(b) & 0x7F) << shift
  103. if b < 0x80 {
  104. break
  105. }
  106. }
  107. if byteLen < 0 {
  108. return ErrInvalidLengthProto
  109. }
  110. postIndex := iNdEx + byteLen
  111. if postIndex > l {
  112. return io.ErrUnexpectedEOF
  113. }
  114. m.Bar = append(m.Bar[:0], dAtA[iNdEx:postIndex]...)
  115. if m.Bar == nil {
  116. m.Bar = []byte{}
  117. }
  118. iNdEx = postIndex
  119. default:
  120. iNdEx = preIndex
  121. skippy, err := skipProto(dAtA[iNdEx:])
  122. if err != nil {
  123. return err
  124. }
  125. if skippy < 0 {
  126. return ErrInvalidLengthProto
  127. }
  128. if (iNdEx + skippy) > l {
  129. return io.ErrUnexpectedEOF
  130. }
  131. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  132. iNdEx += skippy
  133. }
  134. }
  135. if iNdEx > l {
  136. return io.ErrUnexpectedEOF
  137. }
  138. return nil
  139. }
  140. func (m *FooWithRepeated) Unmarshal(dAtA []byte) error {
  141. l := len(dAtA)
  142. iNdEx := 0
  143. for iNdEx < l {
  144. preIndex := iNdEx
  145. var wire uint64
  146. for shift := uint(0); ; shift += 7 {
  147. if shift >= 64 {
  148. return ErrIntOverflowProto
  149. }
  150. if iNdEx >= l {
  151. return io.ErrUnexpectedEOF
  152. }
  153. b := dAtA[iNdEx]
  154. iNdEx++
  155. wire |= (uint64(b) & 0x7F) << shift
  156. if b < 0x80 {
  157. break
  158. }
  159. }
  160. fieldNum := int32(wire >> 3)
  161. wireType := int(wire & 0x7)
  162. if wireType == 4 {
  163. return fmt.Errorf("proto: FooWithRepeated: wiretype end group for non-group")
  164. }
  165. if fieldNum <= 0 {
  166. return fmt.Errorf("proto: FooWithRepeated: illegal tag %d (wire type %d)", fieldNum, wire)
  167. }
  168. switch fieldNum {
  169. case 1:
  170. if wireType != 2 {
  171. return fmt.Errorf("proto: wrong wireType = %d for field Bar", wireType)
  172. }
  173. var byteLen int
  174. for shift := uint(0); ; shift += 7 {
  175. if shift >= 64 {
  176. return ErrIntOverflowProto
  177. }
  178. if iNdEx >= l {
  179. return io.ErrUnexpectedEOF
  180. }
  181. b := dAtA[iNdEx]
  182. iNdEx++
  183. byteLen |= (int(b) & 0x7F) << shift
  184. if b < 0x80 {
  185. break
  186. }
  187. }
  188. if byteLen < 0 {
  189. return ErrInvalidLengthProto
  190. }
  191. postIndex := iNdEx + byteLen
  192. if postIndex > l {
  193. return io.ErrUnexpectedEOF
  194. }
  195. m.Bar = append(m.Bar, make([]byte, postIndex-iNdEx))
  196. copy(m.Bar[len(m.Bar)-1], dAtA[iNdEx:postIndex])
  197. iNdEx = postIndex
  198. default:
  199. iNdEx = preIndex
  200. skippy, err := skipProto(dAtA[iNdEx:])
  201. if err != nil {
  202. return err
  203. }
  204. if skippy < 0 {
  205. return ErrInvalidLengthProto
  206. }
  207. if (iNdEx + skippy) > l {
  208. return io.ErrUnexpectedEOF
  209. }
  210. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  211. iNdEx += skippy
  212. }
  213. }
  214. if iNdEx > l {
  215. return io.ErrUnexpectedEOF
  216. }
  217. return nil
  218. }
  219. func skipProto(dAtA []byte) (n int, err error) {
  220. l := len(dAtA)
  221. iNdEx := 0
  222. for iNdEx < l {
  223. var wire uint64
  224. for shift := uint(0); ; shift += 7 {
  225. if shift >= 64 {
  226. return 0, ErrIntOverflowProto
  227. }
  228. if iNdEx >= l {
  229. return 0, io.ErrUnexpectedEOF
  230. }
  231. b := dAtA[iNdEx]
  232. iNdEx++
  233. wire |= (uint64(b) & 0x7F) << shift
  234. if b < 0x80 {
  235. break
  236. }
  237. }
  238. wireType := int(wire & 0x7)
  239. switch wireType {
  240. case 0:
  241. for shift := uint(0); ; shift += 7 {
  242. if shift >= 64 {
  243. return 0, ErrIntOverflowProto
  244. }
  245. if iNdEx >= l {
  246. return 0, io.ErrUnexpectedEOF
  247. }
  248. iNdEx++
  249. if dAtA[iNdEx-1] < 0x80 {
  250. break
  251. }
  252. }
  253. return iNdEx, nil
  254. case 1:
  255. iNdEx += 8
  256. return iNdEx, nil
  257. case 2:
  258. var length int
  259. for shift := uint(0); ; shift += 7 {
  260. if shift >= 64 {
  261. return 0, ErrIntOverflowProto
  262. }
  263. if iNdEx >= l {
  264. return 0, io.ErrUnexpectedEOF
  265. }
  266. b := dAtA[iNdEx]
  267. iNdEx++
  268. length |= (int(b) & 0x7F) << shift
  269. if b < 0x80 {
  270. break
  271. }
  272. }
  273. iNdEx += length
  274. if length < 0 {
  275. return 0, ErrInvalidLengthProto
  276. }
  277. return iNdEx, nil
  278. case 3:
  279. for {
  280. var innerWire uint64
  281. var start int = iNdEx
  282. for shift := uint(0); ; shift += 7 {
  283. if shift >= 64 {
  284. return 0, ErrIntOverflowProto
  285. }
  286. if iNdEx >= l {
  287. return 0, io.ErrUnexpectedEOF
  288. }
  289. b := dAtA[iNdEx]
  290. iNdEx++
  291. innerWire |= (uint64(b) & 0x7F) << shift
  292. if b < 0x80 {
  293. break
  294. }
  295. }
  296. innerWireType := int(innerWire & 0x7)
  297. if innerWireType == 4 {
  298. break
  299. }
  300. next, err := skipProto(dAtA[start:])
  301. if err != nil {
  302. return 0, err
  303. }
  304. iNdEx = start + next
  305. }
  306. return iNdEx, nil
  307. case 4:
  308. return iNdEx, nil
  309. case 5:
  310. iNdEx += 4
  311. return iNdEx, nil
  312. default:
  313. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  314. }
  315. }
  316. panic("unreachable")
  317. }
  318. var (
  319. ErrInvalidLengthProto = fmt.Errorf("proto: negative length found during unmarshaling")
  320. ErrIntOverflowProto = fmt.Errorf("proto: integer overflow")
  321. )
  322. func init() { proto.RegisterFile("proto.proto", fileDescriptorProto) }
  323. var fileDescriptorProto = []byte{
  324. // 126 bytes of a gzipped FileDescriptorProto
  325. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2e, 0x28, 0xca, 0x2f,
  326. 0xc9, 0xd7, 0x03, 0x93, 0x42, 0xec, 0x99, 0xc5, 0xc5, 0xa5, 0xa9, 0xc6, 0x26, 0x52, 0xba, 0xe9,
  327. 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0xe9, 0xf9, 0xfa, 0x60,
  328. 0xf9, 0xa4, 0xd2, 0x34, 0x30, 0x0f, 0xcc, 0x01, 0xb3, 0x20, 0xfa, 0x94, 0xc4, 0xb9, 0x98, 0xdd,
  329. 0xf2, 0xf3, 0x85, 0x04, 0xb8, 0x98, 0x93, 0x12, 0x8b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82,
  330. 0x40, 0x4c, 0x25, 0x65, 0x2e, 0x7e, 0xb7, 0xfc, 0xfc, 0xf0, 0xcc, 0x92, 0x8c, 0xa0, 0xd4, 0x82,
  331. 0xd4, 0xc4, 0x92, 0xd4, 0x14, 0x84, 0x22, 0x66, 0xa8, 0x22, 0x27, 0x96, 0x0b, 0x8f, 0xe4, 0x18,
  332. 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x00, 0xb2, 0x1b, 0xef, 0x89, 0x00, 0x00, 0x00,
  333. }