object.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: object.proto
  3. /*
  4. Package int64support is a generated protocol buffer package.
  5. It is generated from these files:
  6. object.proto
  7. It has these top-level messages:
  8. Object
  9. */
  10. package int64support
  11. import proto "github.com/gogo/protobuf/proto"
  12. import fmt "fmt"
  13. import math "math"
  14. import _ "github.com/gogo/protobuf/gogoproto"
  15. import strings "strings"
  16. import reflect "reflect"
  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 Object struct {
  28. OptionalNumber *int64 `protobuf:"varint,1,opt,name=optional_number,json=optionalNumber" json:"optional_number,omitempty"`
  29. }
  30. func (m *Object) Reset() { *m = Object{} }
  31. func (*Object) ProtoMessage() {}
  32. func (*Object) Descriptor() ([]byte, []int) { return fileDescriptorObject, []int{0} }
  33. func (m *Object) GetOptionalNumber() int64 {
  34. if m != nil && m.OptionalNumber != nil {
  35. return *m.OptionalNumber
  36. }
  37. return 0
  38. }
  39. func init() {
  40. proto.RegisterType((*Object)(nil), "int64support.Object")
  41. }
  42. func (this *Object) VerboseEqual(that interface{}) error {
  43. if that == nil {
  44. if this == nil {
  45. return nil
  46. }
  47. return fmt.Errorf("that == nil && this != nil")
  48. }
  49. that1, ok := that.(*Object)
  50. if !ok {
  51. that2, ok := that.(Object)
  52. if ok {
  53. that1 = &that2
  54. } else {
  55. return fmt.Errorf("that is not of type *Object")
  56. }
  57. }
  58. if that1 == nil {
  59. if this == nil {
  60. return nil
  61. }
  62. return fmt.Errorf("that is type *Object but is nil && this != nil")
  63. } else if this == nil {
  64. return fmt.Errorf("that is type *Object but is not nil && this == nil")
  65. }
  66. if this.OptionalNumber != nil && that1.OptionalNumber != nil {
  67. if *this.OptionalNumber != *that1.OptionalNumber {
  68. return fmt.Errorf("OptionalNumber this(%v) Not Equal that(%v)", *this.OptionalNumber, *that1.OptionalNumber)
  69. }
  70. } else if this.OptionalNumber != nil {
  71. return fmt.Errorf("this.OptionalNumber == nil && that.OptionalNumber != nil")
  72. } else if that1.OptionalNumber != nil {
  73. return fmt.Errorf("OptionalNumber this(%v) Not Equal that(%v)", this.OptionalNumber, that1.OptionalNumber)
  74. }
  75. return nil
  76. }
  77. func (this *Object) Equal(that interface{}) bool {
  78. if that == nil {
  79. if this == nil {
  80. return true
  81. }
  82. return false
  83. }
  84. that1, ok := that.(*Object)
  85. if !ok {
  86. that2, ok := that.(Object)
  87. if ok {
  88. that1 = &that2
  89. } else {
  90. return false
  91. }
  92. }
  93. if that1 == nil {
  94. if this == nil {
  95. return true
  96. }
  97. return false
  98. } else if this == nil {
  99. return false
  100. }
  101. if this.OptionalNumber != nil && that1.OptionalNumber != nil {
  102. if *this.OptionalNumber != *that1.OptionalNumber {
  103. return false
  104. }
  105. } else if this.OptionalNumber != nil {
  106. return false
  107. } else if that1.OptionalNumber != nil {
  108. return false
  109. }
  110. return true
  111. }
  112. func (this *Object) GoString() string {
  113. if this == nil {
  114. return "nil"
  115. }
  116. s := make([]string, 0, 5)
  117. s = append(s, "&int64support.Object{")
  118. if this.OptionalNumber != nil {
  119. s = append(s, "OptionalNumber: "+valueToGoStringObject(this.OptionalNumber, "int64")+",\n")
  120. }
  121. s = append(s, "}")
  122. return strings.Join(s, "")
  123. }
  124. func valueToGoStringObject(v interface{}, typ string) string {
  125. rv := reflect.ValueOf(v)
  126. if rv.IsNil() {
  127. return "nil"
  128. }
  129. pv := reflect.Indirect(rv).Interface()
  130. return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
  131. }
  132. func (m *Object) Marshal() (dAtA []byte, err error) {
  133. size := m.Size()
  134. dAtA = make([]byte, size)
  135. n, err := m.MarshalTo(dAtA)
  136. if err != nil {
  137. return nil, err
  138. }
  139. return dAtA[:n], nil
  140. }
  141. func (m *Object) MarshalTo(dAtA []byte) (int, error) {
  142. var i int
  143. _ = i
  144. var l int
  145. _ = l
  146. if m.OptionalNumber != nil {
  147. dAtA[i] = 0x8
  148. i++
  149. i = encodeVarintObject(dAtA, i, uint64(*m.OptionalNumber))
  150. }
  151. return i, nil
  152. }
  153. func encodeVarintObject(dAtA []byte, offset int, v uint64) int {
  154. for v >= 1<<7 {
  155. dAtA[offset] = uint8(v&0x7f | 0x80)
  156. v >>= 7
  157. offset++
  158. }
  159. dAtA[offset] = uint8(v)
  160. return offset + 1
  161. }
  162. func NewPopulatedObject(r randyObject, easy bool) *Object {
  163. this := &Object{}
  164. if r.Intn(10) != 0 {
  165. v1 := int64(r.Int63())
  166. if r.Intn(2) == 0 {
  167. v1 *= -1
  168. }
  169. this.OptionalNumber = &v1
  170. }
  171. if !easy && r.Intn(10) != 0 {
  172. }
  173. return this
  174. }
  175. type randyObject interface {
  176. Float32() float32
  177. Float64() float64
  178. Int63() int64
  179. Int31() int32
  180. Uint32() uint32
  181. Intn(n int) int
  182. }
  183. func randUTF8RuneObject(r randyObject) rune {
  184. ru := r.Intn(62)
  185. if ru < 10 {
  186. return rune(ru + 48)
  187. } else if ru < 36 {
  188. return rune(ru + 55)
  189. }
  190. return rune(ru + 61)
  191. }
  192. func randStringObject(r randyObject) string {
  193. v2 := r.Intn(100)
  194. tmps := make([]rune, v2)
  195. for i := 0; i < v2; i++ {
  196. tmps[i] = randUTF8RuneObject(r)
  197. }
  198. return string(tmps)
  199. }
  200. func randUnrecognizedObject(r randyObject, maxFieldNumber int) (dAtA []byte) {
  201. l := r.Intn(5)
  202. for i := 0; i < l; i++ {
  203. wire := r.Intn(4)
  204. if wire == 3 {
  205. wire = 5
  206. }
  207. fieldNumber := maxFieldNumber + r.Intn(100)
  208. dAtA = randFieldObject(dAtA, r, fieldNumber, wire)
  209. }
  210. return dAtA
  211. }
  212. func randFieldObject(dAtA []byte, r randyObject, fieldNumber int, wire int) []byte {
  213. key := uint32(fieldNumber)<<3 | uint32(wire)
  214. switch wire {
  215. case 0:
  216. dAtA = encodeVarintPopulateObject(dAtA, uint64(key))
  217. v3 := r.Int63()
  218. if r.Intn(2) == 0 {
  219. v3 *= -1
  220. }
  221. dAtA = encodeVarintPopulateObject(dAtA, uint64(v3))
  222. case 1:
  223. dAtA = encodeVarintPopulateObject(dAtA, uint64(key))
  224. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  225. case 2:
  226. dAtA = encodeVarintPopulateObject(dAtA, uint64(key))
  227. ll := r.Intn(100)
  228. dAtA = encodeVarintPopulateObject(dAtA, uint64(ll))
  229. for j := 0; j < ll; j++ {
  230. dAtA = append(dAtA, byte(r.Intn(256)))
  231. }
  232. default:
  233. dAtA = encodeVarintPopulateObject(dAtA, uint64(key))
  234. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  235. }
  236. return dAtA
  237. }
  238. func encodeVarintPopulateObject(dAtA []byte, v uint64) []byte {
  239. for v >= 1<<7 {
  240. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  241. v >>= 7
  242. }
  243. dAtA = append(dAtA, uint8(v))
  244. return dAtA
  245. }
  246. func (m *Object) Size() (n int) {
  247. var l int
  248. _ = l
  249. if m.OptionalNumber != nil {
  250. n += 1 + sovObject(uint64(*m.OptionalNumber))
  251. }
  252. return n
  253. }
  254. func sovObject(x uint64) (n int) {
  255. for {
  256. n++
  257. x >>= 7
  258. if x == 0 {
  259. break
  260. }
  261. }
  262. return n
  263. }
  264. func sozObject(x uint64) (n int) {
  265. return sovObject(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  266. }
  267. func (this *Object) String() string {
  268. if this == nil {
  269. return "nil"
  270. }
  271. s := strings.Join([]string{`&Object{`,
  272. `OptionalNumber:` + valueToStringObject(this.OptionalNumber) + `,`,
  273. `}`,
  274. }, "")
  275. return s
  276. }
  277. func valueToStringObject(v interface{}) string {
  278. rv := reflect.ValueOf(v)
  279. if rv.IsNil() {
  280. return "nil"
  281. }
  282. pv := reflect.Indirect(rv).Interface()
  283. return fmt.Sprintf("*%v", pv)
  284. }
  285. func (m *Object) Unmarshal(dAtA []byte) error {
  286. l := len(dAtA)
  287. iNdEx := 0
  288. for iNdEx < l {
  289. preIndex := iNdEx
  290. var wire uint64
  291. for shift := uint(0); ; shift += 7 {
  292. if shift >= 64 {
  293. return ErrIntOverflowObject
  294. }
  295. if iNdEx >= l {
  296. return io.ErrUnexpectedEOF
  297. }
  298. b := dAtA[iNdEx]
  299. iNdEx++
  300. wire |= (uint64(b) & 0x7F) << shift
  301. if b < 0x80 {
  302. break
  303. }
  304. }
  305. fieldNum := int32(wire >> 3)
  306. wireType := int(wire & 0x7)
  307. if wireType == 4 {
  308. return fmt.Errorf("proto: Object: wiretype end group for non-group")
  309. }
  310. if fieldNum <= 0 {
  311. return fmt.Errorf("proto: Object: illegal tag %d (wire type %d)", fieldNum, wire)
  312. }
  313. switch fieldNum {
  314. case 1:
  315. if wireType != 0 {
  316. return fmt.Errorf("proto: wrong wireType = %d for field OptionalNumber", wireType)
  317. }
  318. var v int64
  319. for shift := uint(0); ; shift += 7 {
  320. if shift >= 64 {
  321. return ErrIntOverflowObject
  322. }
  323. if iNdEx >= l {
  324. return io.ErrUnexpectedEOF
  325. }
  326. b := dAtA[iNdEx]
  327. iNdEx++
  328. v |= (int64(b) & 0x7F) << shift
  329. if b < 0x80 {
  330. break
  331. }
  332. }
  333. m.OptionalNumber = &v
  334. default:
  335. iNdEx = preIndex
  336. skippy, err := skipObject(dAtA[iNdEx:])
  337. if err != nil {
  338. return err
  339. }
  340. if skippy < 0 {
  341. return ErrInvalidLengthObject
  342. }
  343. if (iNdEx + skippy) > l {
  344. return io.ErrUnexpectedEOF
  345. }
  346. iNdEx += skippy
  347. }
  348. }
  349. if iNdEx > l {
  350. return io.ErrUnexpectedEOF
  351. }
  352. return nil
  353. }
  354. func skipObject(dAtA []byte) (n int, err error) {
  355. l := len(dAtA)
  356. iNdEx := 0
  357. for iNdEx < l {
  358. var wire uint64
  359. for shift := uint(0); ; shift += 7 {
  360. if shift >= 64 {
  361. return 0, ErrIntOverflowObject
  362. }
  363. if iNdEx >= l {
  364. return 0, io.ErrUnexpectedEOF
  365. }
  366. b := dAtA[iNdEx]
  367. iNdEx++
  368. wire |= (uint64(b) & 0x7F) << shift
  369. if b < 0x80 {
  370. break
  371. }
  372. }
  373. wireType := int(wire & 0x7)
  374. switch wireType {
  375. case 0:
  376. for shift := uint(0); ; shift += 7 {
  377. if shift >= 64 {
  378. return 0, ErrIntOverflowObject
  379. }
  380. if iNdEx >= l {
  381. return 0, io.ErrUnexpectedEOF
  382. }
  383. iNdEx++
  384. if dAtA[iNdEx-1] < 0x80 {
  385. break
  386. }
  387. }
  388. return iNdEx, nil
  389. case 1:
  390. iNdEx += 8
  391. return iNdEx, nil
  392. case 2:
  393. var length int
  394. for shift := uint(0); ; shift += 7 {
  395. if shift >= 64 {
  396. return 0, ErrIntOverflowObject
  397. }
  398. if iNdEx >= l {
  399. return 0, io.ErrUnexpectedEOF
  400. }
  401. b := dAtA[iNdEx]
  402. iNdEx++
  403. length |= (int(b) & 0x7F) << shift
  404. if b < 0x80 {
  405. break
  406. }
  407. }
  408. iNdEx += length
  409. if length < 0 {
  410. return 0, ErrInvalidLengthObject
  411. }
  412. return iNdEx, nil
  413. case 3:
  414. for {
  415. var innerWire uint64
  416. var start int = iNdEx
  417. for shift := uint(0); ; shift += 7 {
  418. if shift >= 64 {
  419. return 0, ErrIntOverflowObject
  420. }
  421. if iNdEx >= l {
  422. return 0, io.ErrUnexpectedEOF
  423. }
  424. b := dAtA[iNdEx]
  425. iNdEx++
  426. innerWire |= (uint64(b) & 0x7F) << shift
  427. if b < 0x80 {
  428. break
  429. }
  430. }
  431. innerWireType := int(innerWire & 0x7)
  432. if innerWireType == 4 {
  433. break
  434. }
  435. next, err := skipObject(dAtA[start:])
  436. if err != nil {
  437. return 0, err
  438. }
  439. iNdEx = start + next
  440. }
  441. return iNdEx, nil
  442. case 4:
  443. return iNdEx, nil
  444. case 5:
  445. iNdEx += 4
  446. return iNdEx, nil
  447. default:
  448. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  449. }
  450. }
  451. panic("unreachable")
  452. }
  453. var (
  454. ErrInvalidLengthObject = fmt.Errorf("proto: negative length found during unmarshaling")
  455. ErrIntOverflowObject = fmt.Errorf("proto: integer overflow")
  456. )
  457. func init() { proto.RegisterFile("object.proto", fileDescriptorObject) }
  458. var fileDescriptorObject = []byte{
  459. // 190 bytes of a gzipped FileDescriptorProto
  460. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x4f, 0xca, 0x4a,
  461. 0x4d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xc9, 0xcc, 0x2b, 0x31, 0x33, 0x29,
  462. 0x2e, 0x2d, 0x28, 0xc8, 0x2f, 0x2a, 0x91, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b,
  463. 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x2b, 0x4a, 0x2a, 0x4d, 0x03, 0xf3, 0xc0,
  464. 0x1c, 0x30, 0x0b, 0xa2, 0x59, 0xc9, 0x90, 0x8b, 0xcd, 0x1f, 0x6c, 0x98, 0x90, 0x3a, 0x17, 0x7f,
  465. 0x7e, 0x41, 0x49, 0x66, 0x7e, 0x5e, 0x62, 0x4e, 0x7c, 0x5e, 0x69, 0x6e, 0x52, 0x6a, 0x91, 0x04,
  466. 0xa3, 0x02, 0xa3, 0x06, 0x73, 0x10, 0x1f, 0x4c, 0xd8, 0x0f, 0x2c, 0xea, 0xe4, 0x75, 0xe1, 0xa1,
  467. 0x1c, 0xc3, 0x8d, 0x87, 0x72, 0x0c, 0x0f, 0x1e, 0xca, 0x31, 0x7e, 0x78, 0x28, 0xc7, 0xf8, 0xe3,
  468. 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x77, 0x3c, 0x92, 0x63, 0x3c,
  469. 0xf0, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63,
  470. 0x7c, 0xf1, 0x48, 0x8e, 0xe1, 0xc3, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0xa2, 0x50, 0x5c,
  471. 0x0b, 0x08, 0x00, 0x00, 0xff, 0xff, 0x73, 0x60, 0x3c, 0xd6, 0xca, 0x00, 0x00, 0x00,
  472. }