kv.pb.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: kv.proto
  3. package mvccpb
  4. import (
  5. fmt "fmt"
  6. io "io"
  7. math "math"
  8. math_bits "math/bits"
  9. _ "github.com/gogo/protobuf/gogoproto"
  10. proto "github.com/golang/protobuf/proto"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the proto package it is being compiled against.
  18. // A compilation error at this line likely means your copy of the
  19. // proto package needs to be updated.
  20. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  21. type Event_EventType int32
  22. const (
  23. PUT Event_EventType = 0
  24. DELETE Event_EventType = 1
  25. )
  26. var Event_EventType_name = map[int32]string{
  27. 0: "PUT",
  28. 1: "DELETE",
  29. }
  30. var Event_EventType_value = map[string]int32{
  31. "PUT": 0,
  32. "DELETE": 1,
  33. }
  34. func (x Event_EventType) String() string {
  35. return proto.EnumName(Event_EventType_name, int32(x))
  36. }
  37. func (Event_EventType) EnumDescriptor() ([]byte, []int) {
  38. return fileDescriptor_2216fe83c9c12408, []int{1, 0}
  39. }
  40. type KeyValue struct {
  41. // key is the key in bytes. An empty key is not allowed.
  42. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  43. // create_revision is the revision of last creation on this key.
  44. CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"`
  45. // mod_revision is the revision of last modification on this key.
  46. ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"`
  47. // version is the version of the key. A deletion resets
  48. // the version to zero and any modification of the key
  49. // increases its version.
  50. Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
  51. // value is the value held by the key, in bytes.
  52. Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
  53. // lease is the ID of the lease that attached to key.
  54. // When the attached lease expires, the key will be deleted.
  55. // If lease is 0, then no lease is attached to the key.
  56. Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"`
  57. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  58. XXX_unrecognized []byte `json:"-"`
  59. XXX_sizecache int32 `json:"-"`
  60. }
  61. func (m *KeyValue) Reset() { *m = KeyValue{} }
  62. func (m *KeyValue) String() string { return proto.CompactTextString(m) }
  63. func (*KeyValue) ProtoMessage() {}
  64. func (*KeyValue) Descriptor() ([]byte, []int) {
  65. return fileDescriptor_2216fe83c9c12408, []int{0}
  66. }
  67. func (m *KeyValue) XXX_Unmarshal(b []byte) error {
  68. return m.Unmarshal(b)
  69. }
  70. func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  71. if deterministic {
  72. return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic)
  73. } else {
  74. b = b[:cap(b)]
  75. n, err := m.MarshalToSizedBuffer(b)
  76. if err != nil {
  77. return nil, err
  78. }
  79. return b[:n], nil
  80. }
  81. }
  82. func (m *KeyValue) XXX_Merge(src proto.Message) {
  83. xxx_messageInfo_KeyValue.Merge(m, src)
  84. }
  85. func (m *KeyValue) XXX_Size() int {
  86. return m.Size()
  87. }
  88. func (m *KeyValue) XXX_DiscardUnknown() {
  89. xxx_messageInfo_KeyValue.DiscardUnknown(m)
  90. }
  91. var xxx_messageInfo_KeyValue proto.InternalMessageInfo
  92. type Event struct {
  93. // type is the kind of event. If type is a PUT, it indicates
  94. // new data has been stored to the key. If type is a DELETE,
  95. // it indicates the key was deleted.
  96. Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=mvccpb.Event_EventType" json:"type,omitempty"`
  97. // kv holds the KeyValue for the event.
  98. // A PUT event contains current kv pair.
  99. // A PUT event with kv.Version=1 indicates the creation of a key.
  100. // A DELETE/EXPIRE event contains the deleted key with
  101. // its modification revision set to the revision of deletion.
  102. Kv *KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"`
  103. // prev_kv holds the key-value pair before the event happens.
  104. PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"`
  105. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  106. XXX_unrecognized []byte `json:"-"`
  107. XXX_sizecache int32 `json:"-"`
  108. }
  109. func (m *Event) Reset() { *m = Event{} }
  110. func (m *Event) String() string { return proto.CompactTextString(m) }
  111. func (*Event) ProtoMessage() {}
  112. func (*Event) Descriptor() ([]byte, []int) {
  113. return fileDescriptor_2216fe83c9c12408, []int{1}
  114. }
  115. func (m *Event) XXX_Unmarshal(b []byte) error {
  116. return m.Unmarshal(b)
  117. }
  118. func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  119. if deterministic {
  120. return xxx_messageInfo_Event.Marshal(b, m, deterministic)
  121. } else {
  122. b = b[:cap(b)]
  123. n, err := m.MarshalToSizedBuffer(b)
  124. if err != nil {
  125. return nil, err
  126. }
  127. return b[:n], nil
  128. }
  129. }
  130. func (m *Event) XXX_Merge(src proto.Message) {
  131. xxx_messageInfo_Event.Merge(m, src)
  132. }
  133. func (m *Event) XXX_Size() int {
  134. return m.Size()
  135. }
  136. func (m *Event) XXX_DiscardUnknown() {
  137. xxx_messageInfo_Event.DiscardUnknown(m)
  138. }
  139. var xxx_messageInfo_Event proto.InternalMessageInfo
  140. func init() {
  141. proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value)
  142. proto.RegisterType((*KeyValue)(nil), "mvccpb.KeyValue")
  143. proto.RegisterType((*Event)(nil), "mvccpb.Event")
  144. }
  145. func init() { proto.RegisterFile("kv.proto", fileDescriptor_2216fe83c9c12408) }
  146. var fileDescriptor_2216fe83c9c12408 = []byte{
  147. // 303 bytes of a gzipped FileDescriptorProto
  148. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4e, 0xc2, 0x40,
  149. 0x14, 0x86, 0x3b, 0x14, 0x0a, 0x3e, 0x08, 0x36, 0x13, 0x12, 0x27, 0x2e, 0x26, 0x95, 0x8d, 0x18,
  150. 0x13, 0x4c, 0xf0, 0x06, 0xc6, 0xae, 0x70, 0x61, 0x1a, 0x74, 0x4b, 0x4a, 0x79, 0x21, 0xa4, 0x94,
  151. 0x69, 0x4a, 0x9d, 0xa4, 0x37, 0x71, 0xef, 0xde, 0x73, 0xb0, 0xe4, 0x08, 0x52, 0x2f, 0x62, 0xfa,
  152. 0xc6, 0xe2, 0xc6, 0xcd, 0xe4, 0xfd, 0xff, 0xff, 0x65, 0xe6, 0x7f, 0x03, 0x9d, 0x58, 0x8f, 0xd3,
  153. 0x4c, 0xe5, 0x8a, 0x3b, 0x89, 0x8e, 0xa2, 0x74, 0x71, 0x39, 0x58, 0xa9, 0x95, 0x22, 0xeb, 0xae,
  154. 0x9a, 0x4c, 0x3a, 0xfc, 0x64, 0xd0, 0x99, 0x62, 0xf1, 0x1a, 0x6e, 0xde, 0x90, 0xbb, 0x60, 0xc7,
  155. 0x58, 0x08, 0xe6, 0xb1, 0x51, 0x2f, 0xa8, 0x46, 0x7e, 0x0d, 0xe7, 0x51, 0x86, 0x61, 0x8e, 0xf3,
  156. 0x0c, 0xf5, 0x7a, 0xb7, 0x56, 0x5b, 0xd1, 0xf0, 0xd8, 0xc8, 0x0e, 0xfa, 0xc6, 0x0e, 0x7e, 0x5d,
  157. 0x7e, 0x05, 0xbd, 0x44, 0x2d, 0xff, 0x28, 0x9b, 0xa8, 0x6e, 0xa2, 0x96, 0x27, 0x44, 0x40, 0x5b,
  158. 0x63, 0x46, 0x69, 0x93, 0xd2, 0x5a, 0xf2, 0x01, 0xb4, 0x74, 0x55, 0x40, 0xb4, 0xe8, 0x65, 0x23,
  159. 0x2a, 0x77, 0x83, 0xe1, 0x0e, 0x85, 0x43, 0xb4, 0x11, 0xc3, 0x0f, 0x06, 0x2d, 0x5f, 0xe3, 0x36,
  160. 0xe7, 0xb7, 0xd0, 0xcc, 0x8b, 0x14, 0xa9, 0x6e, 0x7f, 0x72, 0x31, 0x36, 0x7b, 0x8e, 0x29, 0x34,
  161. 0xe7, 0xac, 0x48, 0x31, 0x20, 0x88, 0x7b, 0xd0, 0x88, 0x35, 0x75, 0xef, 0x4e, 0xdc, 0x1a, 0xad,
  162. 0x17, 0x0f, 0x1a, 0xb1, 0xe6, 0x37, 0xd0, 0x4e, 0x33, 0xd4, 0xf3, 0x58, 0x53, 0xf9, 0xff, 0x30,
  163. 0xa7, 0x02, 0xa6, 0x7a, 0xe8, 0xc1, 0xd9, 0xe9, 0x7e, 0xde, 0x06, 0xfb, 0xf9, 0x65, 0xe6, 0x5a,
  164. 0x1c, 0xc0, 0x79, 0xf4, 0x9f, 0xfc, 0x99, 0xef, 0xb2, 0x07, 0xb1, 0x3f, 0x4a, 0xeb, 0x70, 0x94,
  165. 0xd6, 0xbe, 0x94, 0xec, 0x50, 0x4a, 0xf6, 0x55, 0x4a, 0xf6, 0xfe, 0x2d, 0xad, 0x85, 0x43, 0xff,
  166. 0x7e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x45, 0x92, 0x5d, 0xa1, 0x01, 0x00, 0x00,
  167. }
  168. func (m *KeyValue) Marshal() (dAtA []byte, err error) {
  169. size := m.Size()
  170. dAtA = make([]byte, size)
  171. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  172. if err != nil {
  173. return nil, err
  174. }
  175. return dAtA[:n], nil
  176. }
  177. func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) {
  178. size := m.Size()
  179. return m.MarshalToSizedBuffer(dAtA[:size])
  180. }
  181. func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  182. i := len(dAtA)
  183. _ = i
  184. var l int
  185. _ = l
  186. if m.XXX_unrecognized != nil {
  187. i -= len(m.XXX_unrecognized)
  188. copy(dAtA[i:], m.XXX_unrecognized)
  189. }
  190. if m.Lease != 0 {
  191. i = encodeVarintKv(dAtA, i, uint64(m.Lease))
  192. i--
  193. dAtA[i] = 0x30
  194. }
  195. if len(m.Value) > 0 {
  196. i -= len(m.Value)
  197. copy(dAtA[i:], m.Value)
  198. i = encodeVarintKv(dAtA, i, uint64(len(m.Value)))
  199. i--
  200. dAtA[i] = 0x2a
  201. }
  202. if m.Version != 0 {
  203. i = encodeVarintKv(dAtA, i, uint64(m.Version))
  204. i--
  205. dAtA[i] = 0x20
  206. }
  207. if m.ModRevision != 0 {
  208. i = encodeVarintKv(dAtA, i, uint64(m.ModRevision))
  209. i--
  210. dAtA[i] = 0x18
  211. }
  212. if m.CreateRevision != 0 {
  213. i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision))
  214. i--
  215. dAtA[i] = 0x10
  216. }
  217. if len(m.Key) > 0 {
  218. i -= len(m.Key)
  219. copy(dAtA[i:], m.Key)
  220. i = encodeVarintKv(dAtA, i, uint64(len(m.Key)))
  221. i--
  222. dAtA[i] = 0xa
  223. }
  224. return len(dAtA) - i, nil
  225. }
  226. func (m *Event) Marshal() (dAtA []byte, err error) {
  227. size := m.Size()
  228. dAtA = make([]byte, size)
  229. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  230. if err != nil {
  231. return nil, err
  232. }
  233. return dAtA[:n], nil
  234. }
  235. func (m *Event) MarshalTo(dAtA []byte) (int, error) {
  236. size := m.Size()
  237. return m.MarshalToSizedBuffer(dAtA[:size])
  238. }
  239. func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  240. i := len(dAtA)
  241. _ = i
  242. var l int
  243. _ = l
  244. if m.XXX_unrecognized != nil {
  245. i -= len(m.XXX_unrecognized)
  246. copy(dAtA[i:], m.XXX_unrecognized)
  247. }
  248. if m.PrevKv != nil {
  249. {
  250. size, err := m.PrevKv.MarshalToSizedBuffer(dAtA[:i])
  251. if err != nil {
  252. return 0, err
  253. }
  254. i -= size
  255. i = encodeVarintKv(dAtA, i, uint64(size))
  256. }
  257. i--
  258. dAtA[i] = 0x1a
  259. }
  260. if m.Kv != nil {
  261. {
  262. size, err := m.Kv.MarshalToSizedBuffer(dAtA[:i])
  263. if err != nil {
  264. return 0, err
  265. }
  266. i -= size
  267. i = encodeVarintKv(dAtA, i, uint64(size))
  268. }
  269. i--
  270. dAtA[i] = 0x12
  271. }
  272. if m.Type != 0 {
  273. i = encodeVarintKv(dAtA, i, uint64(m.Type))
  274. i--
  275. dAtA[i] = 0x8
  276. }
  277. return len(dAtA) - i, nil
  278. }
  279. func encodeVarintKv(dAtA []byte, offset int, v uint64) int {
  280. offset -= sovKv(v)
  281. base := offset
  282. for v >= 1<<7 {
  283. dAtA[offset] = uint8(v&0x7f | 0x80)
  284. v >>= 7
  285. offset++
  286. }
  287. dAtA[offset] = uint8(v)
  288. return base
  289. }
  290. func (m *KeyValue) Size() (n int) {
  291. if m == nil {
  292. return 0
  293. }
  294. var l int
  295. _ = l
  296. l = len(m.Key)
  297. if l > 0 {
  298. n += 1 + l + sovKv(uint64(l))
  299. }
  300. if m.CreateRevision != 0 {
  301. n += 1 + sovKv(uint64(m.CreateRevision))
  302. }
  303. if m.ModRevision != 0 {
  304. n += 1 + sovKv(uint64(m.ModRevision))
  305. }
  306. if m.Version != 0 {
  307. n += 1 + sovKv(uint64(m.Version))
  308. }
  309. l = len(m.Value)
  310. if l > 0 {
  311. n += 1 + l + sovKv(uint64(l))
  312. }
  313. if m.Lease != 0 {
  314. n += 1 + sovKv(uint64(m.Lease))
  315. }
  316. if m.XXX_unrecognized != nil {
  317. n += len(m.XXX_unrecognized)
  318. }
  319. return n
  320. }
  321. func (m *Event) Size() (n int) {
  322. if m == nil {
  323. return 0
  324. }
  325. var l int
  326. _ = l
  327. if m.Type != 0 {
  328. n += 1 + sovKv(uint64(m.Type))
  329. }
  330. if m.Kv != nil {
  331. l = m.Kv.Size()
  332. n += 1 + l + sovKv(uint64(l))
  333. }
  334. if m.PrevKv != nil {
  335. l = m.PrevKv.Size()
  336. n += 1 + l + sovKv(uint64(l))
  337. }
  338. if m.XXX_unrecognized != nil {
  339. n += len(m.XXX_unrecognized)
  340. }
  341. return n
  342. }
  343. func sovKv(x uint64) (n int) {
  344. return (math_bits.Len64(x|1) + 6) / 7
  345. }
  346. func sozKv(x uint64) (n int) {
  347. return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  348. }
  349. func (m *KeyValue) Unmarshal(dAtA []byte) error {
  350. l := len(dAtA)
  351. iNdEx := 0
  352. for iNdEx < l {
  353. preIndex := iNdEx
  354. var wire uint64
  355. for shift := uint(0); ; shift += 7 {
  356. if shift >= 64 {
  357. return ErrIntOverflowKv
  358. }
  359. if iNdEx >= l {
  360. return io.ErrUnexpectedEOF
  361. }
  362. b := dAtA[iNdEx]
  363. iNdEx++
  364. wire |= uint64(b&0x7F) << shift
  365. if b < 0x80 {
  366. break
  367. }
  368. }
  369. fieldNum := int32(wire >> 3)
  370. wireType := int(wire & 0x7)
  371. if wireType == 4 {
  372. return fmt.Errorf("proto: KeyValue: wiretype end group for non-group")
  373. }
  374. if fieldNum <= 0 {
  375. return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire)
  376. }
  377. switch fieldNum {
  378. case 1:
  379. if wireType != 2 {
  380. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  381. }
  382. var byteLen int
  383. for shift := uint(0); ; shift += 7 {
  384. if shift >= 64 {
  385. return ErrIntOverflowKv
  386. }
  387. if iNdEx >= l {
  388. return io.ErrUnexpectedEOF
  389. }
  390. b := dAtA[iNdEx]
  391. iNdEx++
  392. byteLen |= int(b&0x7F) << shift
  393. if b < 0x80 {
  394. break
  395. }
  396. }
  397. if byteLen < 0 {
  398. return ErrInvalidLengthKv
  399. }
  400. postIndex := iNdEx + byteLen
  401. if postIndex < 0 {
  402. return ErrInvalidLengthKv
  403. }
  404. if postIndex > l {
  405. return io.ErrUnexpectedEOF
  406. }
  407. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  408. if m.Key == nil {
  409. m.Key = []byte{}
  410. }
  411. iNdEx = postIndex
  412. case 2:
  413. if wireType != 0 {
  414. return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType)
  415. }
  416. m.CreateRevision = 0
  417. for shift := uint(0); ; shift += 7 {
  418. if shift >= 64 {
  419. return ErrIntOverflowKv
  420. }
  421. if iNdEx >= l {
  422. return io.ErrUnexpectedEOF
  423. }
  424. b := dAtA[iNdEx]
  425. iNdEx++
  426. m.CreateRevision |= int64(b&0x7F) << shift
  427. if b < 0x80 {
  428. break
  429. }
  430. }
  431. case 3:
  432. if wireType != 0 {
  433. return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType)
  434. }
  435. m.ModRevision = 0
  436. for shift := uint(0); ; shift += 7 {
  437. if shift >= 64 {
  438. return ErrIntOverflowKv
  439. }
  440. if iNdEx >= l {
  441. return io.ErrUnexpectedEOF
  442. }
  443. b := dAtA[iNdEx]
  444. iNdEx++
  445. m.ModRevision |= int64(b&0x7F) << shift
  446. if b < 0x80 {
  447. break
  448. }
  449. }
  450. case 4:
  451. if wireType != 0 {
  452. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  453. }
  454. m.Version = 0
  455. for shift := uint(0); ; shift += 7 {
  456. if shift >= 64 {
  457. return ErrIntOverflowKv
  458. }
  459. if iNdEx >= l {
  460. return io.ErrUnexpectedEOF
  461. }
  462. b := dAtA[iNdEx]
  463. iNdEx++
  464. m.Version |= int64(b&0x7F) << shift
  465. if b < 0x80 {
  466. break
  467. }
  468. }
  469. case 5:
  470. if wireType != 2 {
  471. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  472. }
  473. var byteLen int
  474. for shift := uint(0); ; shift += 7 {
  475. if shift >= 64 {
  476. return ErrIntOverflowKv
  477. }
  478. if iNdEx >= l {
  479. return io.ErrUnexpectedEOF
  480. }
  481. b := dAtA[iNdEx]
  482. iNdEx++
  483. byteLen |= int(b&0x7F) << shift
  484. if b < 0x80 {
  485. break
  486. }
  487. }
  488. if byteLen < 0 {
  489. return ErrInvalidLengthKv
  490. }
  491. postIndex := iNdEx + byteLen
  492. if postIndex < 0 {
  493. return ErrInvalidLengthKv
  494. }
  495. if postIndex > l {
  496. return io.ErrUnexpectedEOF
  497. }
  498. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  499. if m.Value == nil {
  500. m.Value = []byte{}
  501. }
  502. iNdEx = postIndex
  503. case 6:
  504. if wireType != 0 {
  505. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  506. }
  507. m.Lease = 0
  508. for shift := uint(0); ; shift += 7 {
  509. if shift >= 64 {
  510. return ErrIntOverflowKv
  511. }
  512. if iNdEx >= l {
  513. return io.ErrUnexpectedEOF
  514. }
  515. b := dAtA[iNdEx]
  516. iNdEx++
  517. m.Lease |= int64(b&0x7F) << shift
  518. if b < 0x80 {
  519. break
  520. }
  521. }
  522. default:
  523. iNdEx = preIndex
  524. skippy, err := skipKv(dAtA[iNdEx:])
  525. if err != nil {
  526. return err
  527. }
  528. if (skippy < 0) || (iNdEx+skippy) < 0 {
  529. return ErrInvalidLengthKv
  530. }
  531. if (iNdEx + skippy) > l {
  532. return io.ErrUnexpectedEOF
  533. }
  534. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  535. iNdEx += skippy
  536. }
  537. }
  538. if iNdEx > l {
  539. return io.ErrUnexpectedEOF
  540. }
  541. return nil
  542. }
  543. func (m *Event) Unmarshal(dAtA []byte) error {
  544. l := len(dAtA)
  545. iNdEx := 0
  546. for iNdEx < l {
  547. preIndex := iNdEx
  548. var wire uint64
  549. for shift := uint(0); ; shift += 7 {
  550. if shift >= 64 {
  551. return ErrIntOverflowKv
  552. }
  553. if iNdEx >= l {
  554. return io.ErrUnexpectedEOF
  555. }
  556. b := dAtA[iNdEx]
  557. iNdEx++
  558. wire |= uint64(b&0x7F) << shift
  559. if b < 0x80 {
  560. break
  561. }
  562. }
  563. fieldNum := int32(wire >> 3)
  564. wireType := int(wire & 0x7)
  565. if wireType == 4 {
  566. return fmt.Errorf("proto: Event: wiretype end group for non-group")
  567. }
  568. if fieldNum <= 0 {
  569. return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire)
  570. }
  571. switch fieldNum {
  572. case 1:
  573. if wireType != 0 {
  574. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  575. }
  576. m.Type = 0
  577. for shift := uint(0); ; shift += 7 {
  578. if shift >= 64 {
  579. return ErrIntOverflowKv
  580. }
  581. if iNdEx >= l {
  582. return io.ErrUnexpectedEOF
  583. }
  584. b := dAtA[iNdEx]
  585. iNdEx++
  586. m.Type |= Event_EventType(b&0x7F) << shift
  587. if b < 0x80 {
  588. break
  589. }
  590. }
  591. case 2:
  592. if wireType != 2 {
  593. return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType)
  594. }
  595. var msglen int
  596. for shift := uint(0); ; shift += 7 {
  597. if shift >= 64 {
  598. return ErrIntOverflowKv
  599. }
  600. if iNdEx >= l {
  601. return io.ErrUnexpectedEOF
  602. }
  603. b := dAtA[iNdEx]
  604. iNdEx++
  605. msglen |= int(b&0x7F) << shift
  606. if b < 0x80 {
  607. break
  608. }
  609. }
  610. if msglen < 0 {
  611. return ErrInvalidLengthKv
  612. }
  613. postIndex := iNdEx + msglen
  614. if postIndex < 0 {
  615. return ErrInvalidLengthKv
  616. }
  617. if postIndex > l {
  618. return io.ErrUnexpectedEOF
  619. }
  620. if m.Kv == nil {
  621. m.Kv = &KeyValue{}
  622. }
  623. if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  624. return err
  625. }
  626. iNdEx = postIndex
  627. case 3:
  628. if wireType != 2 {
  629. return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType)
  630. }
  631. var msglen int
  632. for shift := uint(0); ; shift += 7 {
  633. if shift >= 64 {
  634. return ErrIntOverflowKv
  635. }
  636. if iNdEx >= l {
  637. return io.ErrUnexpectedEOF
  638. }
  639. b := dAtA[iNdEx]
  640. iNdEx++
  641. msglen |= int(b&0x7F) << shift
  642. if b < 0x80 {
  643. break
  644. }
  645. }
  646. if msglen < 0 {
  647. return ErrInvalidLengthKv
  648. }
  649. postIndex := iNdEx + msglen
  650. if postIndex < 0 {
  651. return ErrInvalidLengthKv
  652. }
  653. if postIndex > l {
  654. return io.ErrUnexpectedEOF
  655. }
  656. if m.PrevKv == nil {
  657. m.PrevKv = &KeyValue{}
  658. }
  659. if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  660. return err
  661. }
  662. iNdEx = postIndex
  663. default:
  664. iNdEx = preIndex
  665. skippy, err := skipKv(dAtA[iNdEx:])
  666. if err != nil {
  667. return err
  668. }
  669. if (skippy < 0) || (iNdEx+skippy) < 0 {
  670. return ErrInvalidLengthKv
  671. }
  672. if (iNdEx + skippy) > l {
  673. return io.ErrUnexpectedEOF
  674. }
  675. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  676. iNdEx += skippy
  677. }
  678. }
  679. if iNdEx > l {
  680. return io.ErrUnexpectedEOF
  681. }
  682. return nil
  683. }
  684. func skipKv(dAtA []byte) (n int, err error) {
  685. l := len(dAtA)
  686. iNdEx := 0
  687. depth := 0
  688. for iNdEx < l {
  689. var wire uint64
  690. for shift := uint(0); ; shift += 7 {
  691. if shift >= 64 {
  692. return 0, ErrIntOverflowKv
  693. }
  694. if iNdEx >= l {
  695. return 0, io.ErrUnexpectedEOF
  696. }
  697. b := dAtA[iNdEx]
  698. iNdEx++
  699. wire |= (uint64(b) & 0x7F) << shift
  700. if b < 0x80 {
  701. break
  702. }
  703. }
  704. wireType := int(wire & 0x7)
  705. switch wireType {
  706. case 0:
  707. for shift := uint(0); ; shift += 7 {
  708. if shift >= 64 {
  709. return 0, ErrIntOverflowKv
  710. }
  711. if iNdEx >= l {
  712. return 0, io.ErrUnexpectedEOF
  713. }
  714. iNdEx++
  715. if dAtA[iNdEx-1] < 0x80 {
  716. break
  717. }
  718. }
  719. case 1:
  720. iNdEx += 8
  721. case 2:
  722. var length int
  723. for shift := uint(0); ; shift += 7 {
  724. if shift >= 64 {
  725. return 0, ErrIntOverflowKv
  726. }
  727. if iNdEx >= l {
  728. return 0, io.ErrUnexpectedEOF
  729. }
  730. b := dAtA[iNdEx]
  731. iNdEx++
  732. length |= (int(b) & 0x7F) << shift
  733. if b < 0x80 {
  734. break
  735. }
  736. }
  737. if length < 0 {
  738. return 0, ErrInvalidLengthKv
  739. }
  740. iNdEx += length
  741. case 3:
  742. depth++
  743. case 4:
  744. if depth == 0 {
  745. return 0, ErrUnexpectedEndOfGroupKv
  746. }
  747. depth--
  748. case 5:
  749. iNdEx += 4
  750. default:
  751. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  752. }
  753. if iNdEx < 0 {
  754. return 0, ErrInvalidLengthKv
  755. }
  756. if depth == 0 {
  757. return iNdEx, nil
  758. }
  759. }
  760. return 0, io.ErrUnexpectedEOF
  761. }
  762. var (
  763. ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling")
  764. ErrIntOverflowKv = fmt.Errorf("proto: integer overflow")
  765. ErrUnexpectedEndOfGroupKv = fmt.Errorf("proto: unexpected end of group")
  766. )