You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

511 lines
12 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: libs/kv/types.proto
  3. package kv
  4. import (
  5. bytes "bytes"
  6. fmt "fmt"
  7. _ "github.com/gogo/protobuf/gogoproto"
  8. proto "github.com/gogo/protobuf/proto"
  9. golang_proto "github.com/golang/protobuf/proto"
  10. io "io"
  11. math "math"
  12. math_bits "math/bits"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = golang_proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. // A compilation error at this line likely means your copy of the
  22. // proto package needs to be updated.
  23. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  24. type Pair struct {
  25. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  26. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
  27. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  28. XXX_unrecognized []byte `json:"-"`
  29. XXX_sizecache int32 `json:"-"`
  30. }
  31. func (m *Pair) Reset() { *m = Pair{} }
  32. func (m *Pair) String() string { return proto.CompactTextString(m) }
  33. func (*Pair) ProtoMessage() {}
  34. func (*Pair) Descriptor() ([]byte, []int) {
  35. return fileDescriptor_31432671d164f444, []int{0}
  36. }
  37. func (m *Pair) XXX_Unmarshal(b []byte) error {
  38. return m.Unmarshal(b)
  39. }
  40. func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  41. if deterministic {
  42. return xxx_messageInfo_Pair.Marshal(b, m, deterministic)
  43. } else {
  44. b = b[:cap(b)]
  45. n, err := m.MarshalToSizedBuffer(b)
  46. if err != nil {
  47. return nil, err
  48. }
  49. return b[:n], nil
  50. }
  51. }
  52. func (m *Pair) XXX_Merge(src proto.Message) {
  53. xxx_messageInfo_Pair.Merge(m, src)
  54. }
  55. func (m *Pair) XXX_Size() int {
  56. return m.Size()
  57. }
  58. func (m *Pair) XXX_DiscardUnknown() {
  59. xxx_messageInfo_Pair.DiscardUnknown(m)
  60. }
  61. var xxx_messageInfo_Pair proto.InternalMessageInfo
  62. func (m *Pair) GetKey() []byte {
  63. if m != nil {
  64. return m.Key
  65. }
  66. return nil
  67. }
  68. func (m *Pair) GetValue() []byte {
  69. if m != nil {
  70. return m.Value
  71. }
  72. return nil
  73. }
  74. func init() {
  75. proto.RegisterType((*Pair)(nil), "tendermint.libs.kv.Pair")
  76. golang_proto.RegisterType((*Pair)(nil), "tendermint.libs.kv.Pair")
  77. }
  78. func init() { proto.RegisterFile("libs/kv/types.proto", fileDescriptor_31432671d164f444) }
  79. func init() { golang_proto.RegisterFile("libs/kv/types.proto", fileDescriptor_31432671d164f444) }
  80. var fileDescriptor_31432671d164f444 = []byte{
  81. // 182 bytes of a gzipped FileDescriptorProto
  82. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xc9, 0x4c, 0x2a,
  83. 0xd6, 0xcf, 0x2e, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
  84. 0x12, 0x2a, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x03, 0xc9, 0xeb, 0x65,
  85. 0x97, 0x49, 0xa9, 0x95, 0x64, 0x64, 0x16, 0xa5, 0xc4, 0x17, 0x24, 0x16, 0x95, 0x54, 0xea, 0x83,
  86. 0x95, 0xe9, 0xa7, 0xe7, 0xa7, 0xe7, 0x23, 0x58, 0x10, 0xbd, 0x4a, 0x7a, 0x5c, 0x2c, 0x01, 0x89,
  87. 0x99, 0x45, 0x42, 0x02, 0x5c, 0xcc, 0xd9, 0xa9, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41,
  88. 0x20, 0xa6, 0x90, 0x08, 0x17, 0x6b, 0x59, 0x62, 0x4e, 0x69, 0xaa, 0x04, 0x13, 0x58, 0x0c, 0xc2,
  89. 0x71, 0x72, 0xfb, 0xf1, 0x50, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x1d, 0x8f, 0xe4, 0x18, 0x4f,
  90. 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x03, 0x8f, 0xe5, 0x18,
  91. 0xa3, 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x11, 0x8e, 0x42,
  92. 0x66, 0x42, 0xdd, 0x9f, 0xc4, 0x06, 0xb6, 0xde, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x3a,
  93. 0xdc, 0xba, 0xd1, 0x00, 0x00, 0x00,
  94. }
  95. func (this *Pair) Equal(that interface{}) bool {
  96. if that == nil {
  97. return this == nil
  98. }
  99. that1, ok := that.(*Pair)
  100. if !ok {
  101. that2, ok := that.(Pair)
  102. if ok {
  103. that1 = &that2
  104. } else {
  105. return false
  106. }
  107. }
  108. if that1 == nil {
  109. return this == nil
  110. } else if this == nil {
  111. return false
  112. }
  113. if !bytes.Equal(this.Key, that1.Key) {
  114. return false
  115. }
  116. if !bytes.Equal(this.Value, that1.Value) {
  117. return false
  118. }
  119. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  120. return false
  121. }
  122. return true
  123. }
  124. func (m *Pair) Marshal() (dAtA []byte, err error) {
  125. size := m.Size()
  126. dAtA = make([]byte, size)
  127. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  128. if err != nil {
  129. return nil, err
  130. }
  131. return dAtA[:n], nil
  132. }
  133. func (m *Pair) MarshalTo(dAtA []byte) (int, error) {
  134. size := m.Size()
  135. return m.MarshalToSizedBuffer(dAtA[:size])
  136. }
  137. func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  138. i := len(dAtA)
  139. _ = i
  140. var l int
  141. _ = l
  142. if m.XXX_unrecognized != nil {
  143. i -= len(m.XXX_unrecognized)
  144. copy(dAtA[i:], m.XXX_unrecognized)
  145. }
  146. if len(m.Value) > 0 {
  147. i -= len(m.Value)
  148. copy(dAtA[i:], m.Value)
  149. i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
  150. i--
  151. dAtA[i] = 0x12
  152. }
  153. if len(m.Key) > 0 {
  154. i -= len(m.Key)
  155. copy(dAtA[i:], m.Key)
  156. i = encodeVarintTypes(dAtA, i, uint64(len(m.Key)))
  157. i--
  158. dAtA[i] = 0xa
  159. }
  160. return len(dAtA) - i, nil
  161. }
  162. func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
  163. offset -= sovTypes(v)
  164. base := offset
  165. for v >= 1<<7 {
  166. dAtA[offset] = uint8(v&0x7f | 0x80)
  167. v >>= 7
  168. offset++
  169. }
  170. dAtA[offset] = uint8(v)
  171. return base
  172. }
  173. func NewPopulatedPair(r randyTypes, easy bool) *Pair {
  174. this := &Pair{}
  175. v1 := r.Intn(100)
  176. this.Key = make([]byte, v1)
  177. for i := 0; i < v1; i++ {
  178. this.Key[i] = byte(r.Intn(256))
  179. }
  180. v2 := r.Intn(100)
  181. this.Value = make([]byte, v2)
  182. for i := 0; i < v2; i++ {
  183. this.Value[i] = byte(r.Intn(256))
  184. }
  185. if !easy && r.Intn(10) != 0 {
  186. this.XXX_unrecognized = randUnrecognizedTypes(r, 3)
  187. }
  188. return this
  189. }
  190. type randyTypes interface {
  191. Float32() float32
  192. Float64() float64
  193. Int63() int64
  194. Int31() int32
  195. Uint32() uint32
  196. Intn(n int) int
  197. }
  198. func randUTF8RuneTypes(r randyTypes) rune {
  199. ru := r.Intn(62)
  200. if ru < 10 {
  201. return rune(ru + 48)
  202. } else if ru < 36 {
  203. return rune(ru + 55)
  204. }
  205. return rune(ru + 61)
  206. }
  207. func randStringTypes(r randyTypes) string {
  208. v3 := r.Intn(100)
  209. tmps := make([]rune, v3)
  210. for i := 0; i < v3; i++ {
  211. tmps[i] = randUTF8RuneTypes(r)
  212. }
  213. return string(tmps)
  214. }
  215. func randUnrecognizedTypes(r randyTypes, maxFieldNumber int) (dAtA []byte) {
  216. l := r.Intn(5)
  217. for i := 0; i < l; i++ {
  218. wire := r.Intn(4)
  219. if wire == 3 {
  220. wire = 5
  221. }
  222. fieldNumber := maxFieldNumber + r.Intn(100)
  223. dAtA = randFieldTypes(dAtA, r, fieldNumber, wire)
  224. }
  225. return dAtA
  226. }
  227. func randFieldTypes(dAtA []byte, r randyTypes, fieldNumber int, wire int) []byte {
  228. key := uint32(fieldNumber)<<3 | uint32(wire)
  229. switch wire {
  230. case 0:
  231. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  232. v4 := r.Int63()
  233. if r.Intn(2) == 0 {
  234. v4 *= -1
  235. }
  236. dAtA = encodeVarintPopulateTypes(dAtA, uint64(v4))
  237. case 1:
  238. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  239. 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)))
  240. case 2:
  241. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  242. ll := r.Intn(100)
  243. dAtA = encodeVarintPopulateTypes(dAtA, uint64(ll))
  244. for j := 0; j < ll; j++ {
  245. dAtA = append(dAtA, byte(r.Intn(256)))
  246. }
  247. default:
  248. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  249. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  250. }
  251. return dAtA
  252. }
  253. func encodeVarintPopulateTypes(dAtA []byte, v uint64) []byte {
  254. for v >= 1<<7 {
  255. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  256. v >>= 7
  257. }
  258. dAtA = append(dAtA, uint8(v))
  259. return dAtA
  260. }
  261. func (m *Pair) Size() (n int) {
  262. if m == nil {
  263. return 0
  264. }
  265. var l int
  266. _ = l
  267. l = len(m.Key)
  268. if l > 0 {
  269. n += 1 + l + sovTypes(uint64(l))
  270. }
  271. l = len(m.Value)
  272. if l > 0 {
  273. n += 1 + l + sovTypes(uint64(l))
  274. }
  275. if m.XXX_unrecognized != nil {
  276. n += len(m.XXX_unrecognized)
  277. }
  278. return n
  279. }
  280. func sovTypes(x uint64) (n int) {
  281. return (math_bits.Len64(x|1) + 6) / 7
  282. }
  283. func sozTypes(x uint64) (n int) {
  284. return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  285. }
  286. func (m *Pair) Unmarshal(dAtA []byte) error {
  287. l := len(dAtA)
  288. iNdEx := 0
  289. for iNdEx < l {
  290. preIndex := iNdEx
  291. var wire uint64
  292. for shift := uint(0); ; shift += 7 {
  293. if shift >= 64 {
  294. return ErrIntOverflowTypes
  295. }
  296. if iNdEx >= l {
  297. return io.ErrUnexpectedEOF
  298. }
  299. b := dAtA[iNdEx]
  300. iNdEx++
  301. wire |= uint64(b&0x7F) << shift
  302. if b < 0x80 {
  303. break
  304. }
  305. }
  306. fieldNum := int32(wire >> 3)
  307. wireType := int(wire & 0x7)
  308. if wireType == 4 {
  309. return fmt.Errorf("proto: Pair: wiretype end group for non-group")
  310. }
  311. if fieldNum <= 0 {
  312. return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire)
  313. }
  314. switch fieldNum {
  315. case 1:
  316. if wireType != 2 {
  317. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  318. }
  319. var byteLen int
  320. for shift := uint(0); ; shift += 7 {
  321. if shift >= 64 {
  322. return ErrIntOverflowTypes
  323. }
  324. if iNdEx >= l {
  325. return io.ErrUnexpectedEOF
  326. }
  327. b := dAtA[iNdEx]
  328. iNdEx++
  329. byteLen |= int(b&0x7F) << shift
  330. if b < 0x80 {
  331. break
  332. }
  333. }
  334. if byteLen < 0 {
  335. return ErrInvalidLengthTypes
  336. }
  337. postIndex := iNdEx + byteLen
  338. if postIndex < 0 {
  339. return ErrInvalidLengthTypes
  340. }
  341. if postIndex > l {
  342. return io.ErrUnexpectedEOF
  343. }
  344. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  345. if m.Key == nil {
  346. m.Key = []byte{}
  347. }
  348. iNdEx = postIndex
  349. case 2:
  350. if wireType != 2 {
  351. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  352. }
  353. var byteLen int
  354. for shift := uint(0); ; shift += 7 {
  355. if shift >= 64 {
  356. return ErrIntOverflowTypes
  357. }
  358. if iNdEx >= l {
  359. return io.ErrUnexpectedEOF
  360. }
  361. b := dAtA[iNdEx]
  362. iNdEx++
  363. byteLen |= int(b&0x7F) << shift
  364. if b < 0x80 {
  365. break
  366. }
  367. }
  368. if byteLen < 0 {
  369. return ErrInvalidLengthTypes
  370. }
  371. postIndex := iNdEx + byteLen
  372. if postIndex < 0 {
  373. return ErrInvalidLengthTypes
  374. }
  375. if postIndex > l {
  376. return io.ErrUnexpectedEOF
  377. }
  378. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  379. if m.Value == nil {
  380. m.Value = []byte{}
  381. }
  382. iNdEx = postIndex
  383. default:
  384. iNdEx = preIndex
  385. skippy, err := skipTypes(dAtA[iNdEx:])
  386. if err != nil {
  387. return err
  388. }
  389. if skippy < 0 {
  390. return ErrInvalidLengthTypes
  391. }
  392. if (iNdEx + skippy) < 0 {
  393. return ErrInvalidLengthTypes
  394. }
  395. if (iNdEx + skippy) > l {
  396. return io.ErrUnexpectedEOF
  397. }
  398. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  399. iNdEx += skippy
  400. }
  401. }
  402. if iNdEx > l {
  403. return io.ErrUnexpectedEOF
  404. }
  405. return nil
  406. }
  407. func skipTypes(dAtA []byte) (n int, err error) {
  408. l := len(dAtA)
  409. iNdEx := 0
  410. depth := 0
  411. for iNdEx < l {
  412. var wire uint64
  413. for shift := uint(0); ; shift += 7 {
  414. if shift >= 64 {
  415. return 0, ErrIntOverflowTypes
  416. }
  417. if iNdEx >= l {
  418. return 0, io.ErrUnexpectedEOF
  419. }
  420. b := dAtA[iNdEx]
  421. iNdEx++
  422. wire |= (uint64(b) & 0x7F) << shift
  423. if b < 0x80 {
  424. break
  425. }
  426. }
  427. wireType := int(wire & 0x7)
  428. switch wireType {
  429. case 0:
  430. for shift := uint(0); ; shift += 7 {
  431. if shift >= 64 {
  432. return 0, ErrIntOverflowTypes
  433. }
  434. if iNdEx >= l {
  435. return 0, io.ErrUnexpectedEOF
  436. }
  437. iNdEx++
  438. if dAtA[iNdEx-1] < 0x80 {
  439. break
  440. }
  441. }
  442. case 1:
  443. iNdEx += 8
  444. case 2:
  445. var length int
  446. for shift := uint(0); ; shift += 7 {
  447. if shift >= 64 {
  448. return 0, ErrIntOverflowTypes
  449. }
  450. if iNdEx >= l {
  451. return 0, io.ErrUnexpectedEOF
  452. }
  453. b := dAtA[iNdEx]
  454. iNdEx++
  455. length |= (int(b) & 0x7F) << shift
  456. if b < 0x80 {
  457. break
  458. }
  459. }
  460. if length < 0 {
  461. return 0, ErrInvalidLengthTypes
  462. }
  463. iNdEx += length
  464. case 3:
  465. depth++
  466. case 4:
  467. if depth == 0 {
  468. return 0, ErrUnexpectedEndOfGroupTypes
  469. }
  470. depth--
  471. case 5:
  472. iNdEx += 4
  473. default:
  474. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  475. }
  476. if iNdEx < 0 {
  477. return 0, ErrInvalidLengthTypes
  478. }
  479. if depth == 0 {
  480. return iNdEx, nil
  481. }
  482. }
  483. return 0, io.ErrUnexpectedEOF
  484. }
  485. var (
  486. ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
  487. ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
  488. ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
  489. )