v3lock.pb.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948
  1. // Code generated by protoc-gen-gogo.
  2. // source: v3lock.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package v3lockpb is a generated protocol buffer package.
  6. It is generated from these files:
  7. v3lock.proto
  8. It has these top-level messages:
  9. LockRequest
  10. LockResponse
  11. UnlockRequest
  12. UnlockResponse
  13. */
  14. package v3lockpb
  15. import (
  16. "fmt"
  17. proto "github.com/golang/protobuf/proto"
  18. math "math"
  19. etcdserverpb "github.com/coreos/etcd/etcdserver/etcdserverpb"
  20. context "golang.org/x/net/context"
  21. grpc "google.golang.org/grpc"
  22. io "io"
  23. )
  24. // Reference imports to suppress errors if they are not otherwise used.
  25. var _ = proto.Marshal
  26. var _ = fmt.Errorf
  27. var _ = math.Inf
  28. // This is a compile-time assertion to ensure that this generated file
  29. // is compatible with the proto package it is being compiled against.
  30. // A compilation error at this line likely means your copy of the
  31. // proto package needs to be updated.
  32. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  33. type LockRequest struct {
  34. // name is the identifier for the distributed shared lock to be acquired.
  35. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  36. // lease is the ID of the lease that will be attached to ownership of the
  37. // lock. If the lease expires or is revoked and currently holds the lock,
  38. // the lock is automatically released. Calls to Lock with the same lease will
  39. // be treated as a single acquistion; locking twice with the same lease is a
  40. // no-op.
  41. Lease int64 `protobuf:"varint,2,opt,name=lease,proto3" json:"lease,omitempty"`
  42. }
  43. func (m *LockRequest) Reset() { *m = LockRequest{} }
  44. func (m *LockRequest) String() string { return proto.CompactTextString(m) }
  45. func (*LockRequest) ProtoMessage() {}
  46. func (*LockRequest) Descriptor() ([]byte, []int) { return fileDescriptorV3Lock, []int{0} }
  47. type LockResponse struct {
  48. Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  49. // key is a key that will exist on etcd for the duration that the Lock caller
  50. // owns the lock. Users should not modify this key or the lock may exhibit
  51. // undefined behavior.
  52. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
  53. }
  54. func (m *LockResponse) Reset() { *m = LockResponse{} }
  55. func (m *LockResponse) String() string { return proto.CompactTextString(m) }
  56. func (*LockResponse) ProtoMessage() {}
  57. func (*LockResponse) Descriptor() ([]byte, []int) { return fileDescriptorV3Lock, []int{1} }
  58. func (m *LockResponse) GetHeader() *etcdserverpb.ResponseHeader {
  59. if m != nil {
  60. return m.Header
  61. }
  62. return nil
  63. }
  64. type UnlockRequest struct {
  65. // key is the lock ownership key granted by Lock.
  66. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  67. }
  68. func (m *UnlockRequest) Reset() { *m = UnlockRequest{} }
  69. func (m *UnlockRequest) String() string { return proto.CompactTextString(m) }
  70. func (*UnlockRequest) ProtoMessage() {}
  71. func (*UnlockRequest) Descriptor() ([]byte, []int) { return fileDescriptorV3Lock, []int{2} }
  72. type UnlockResponse struct {
  73. Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
  74. }
  75. func (m *UnlockResponse) Reset() { *m = UnlockResponse{} }
  76. func (m *UnlockResponse) String() string { return proto.CompactTextString(m) }
  77. func (*UnlockResponse) ProtoMessage() {}
  78. func (*UnlockResponse) Descriptor() ([]byte, []int) { return fileDescriptorV3Lock, []int{3} }
  79. func (m *UnlockResponse) GetHeader() *etcdserverpb.ResponseHeader {
  80. if m != nil {
  81. return m.Header
  82. }
  83. return nil
  84. }
  85. func init() {
  86. proto.RegisterType((*LockRequest)(nil), "v3lockpb.LockRequest")
  87. proto.RegisterType((*LockResponse)(nil), "v3lockpb.LockResponse")
  88. proto.RegisterType((*UnlockRequest)(nil), "v3lockpb.UnlockRequest")
  89. proto.RegisterType((*UnlockResponse)(nil), "v3lockpb.UnlockResponse")
  90. }
  91. // Reference imports to suppress errors if they are not otherwise used.
  92. var _ context.Context
  93. var _ grpc.ClientConn
  94. // This is a compile-time assertion to ensure that this generated file
  95. // is compatible with the grpc package it is being compiled against.
  96. const _ = grpc.SupportPackageIsVersion4
  97. // Client API for Lock service
  98. type LockClient interface {
  99. // Lock acquires a distributed shared lock on a given named lock.
  100. // On success, it will return a unique key that exists so long as the
  101. // lock is held by the caller. This key can be used in conjunction with
  102. // transactions to safely ensure updates to etcd only occur while holding
  103. // lock ownership. The lock is held until Unlock is called on the key or the
  104. // lease associate with the owner expires.
  105. Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error)
  106. // Unlock takes a key returned by Lock and releases the hold on lock. The
  107. // next Lock caller waiting for the lock will then be woken up and given
  108. // ownership of the lock.
  109. Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error)
  110. }
  111. type lockClient struct {
  112. cc *grpc.ClientConn
  113. }
  114. func NewLockClient(cc *grpc.ClientConn) LockClient {
  115. return &lockClient{cc}
  116. }
  117. func (c *lockClient) Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) {
  118. out := new(LockResponse)
  119. err := grpc.Invoke(ctx, "/v3lockpb.Lock/Lock", in, out, c.cc, opts...)
  120. if err != nil {
  121. return nil, err
  122. }
  123. return out, nil
  124. }
  125. func (c *lockClient) Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) {
  126. out := new(UnlockResponse)
  127. err := grpc.Invoke(ctx, "/v3lockpb.Lock/Unlock", in, out, c.cc, opts...)
  128. if err != nil {
  129. return nil, err
  130. }
  131. return out, nil
  132. }
  133. // Server API for Lock service
  134. type LockServer interface {
  135. // Lock acquires a distributed shared lock on a given named lock.
  136. // On success, it will return a unique key that exists so long as the
  137. // lock is held by the caller. This key can be used in conjunction with
  138. // transactions to safely ensure updates to etcd only occur while holding
  139. // lock ownership. The lock is held until Unlock is called on the key or the
  140. // lease associate with the owner expires.
  141. Lock(context.Context, *LockRequest) (*LockResponse, error)
  142. // Unlock takes a key returned by Lock and releases the hold on lock. The
  143. // next Lock caller waiting for the lock will then be woken up and given
  144. // ownership of the lock.
  145. Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error)
  146. }
  147. func RegisterLockServer(s *grpc.Server, srv LockServer) {
  148. s.RegisterService(&_Lock_serviceDesc, srv)
  149. }
  150. func _Lock_Lock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  151. in := new(LockRequest)
  152. if err := dec(in); err != nil {
  153. return nil, err
  154. }
  155. if interceptor == nil {
  156. return srv.(LockServer).Lock(ctx, in)
  157. }
  158. info := &grpc.UnaryServerInfo{
  159. Server: srv,
  160. FullMethod: "/v3lockpb.Lock/Lock",
  161. }
  162. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  163. return srv.(LockServer).Lock(ctx, req.(*LockRequest))
  164. }
  165. return interceptor(ctx, in, info, handler)
  166. }
  167. func _Lock_Unlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  168. in := new(UnlockRequest)
  169. if err := dec(in); err != nil {
  170. return nil, err
  171. }
  172. if interceptor == nil {
  173. return srv.(LockServer).Unlock(ctx, in)
  174. }
  175. info := &grpc.UnaryServerInfo{
  176. Server: srv,
  177. FullMethod: "/v3lockpb.Lock/Unlock",
  178. }
  179. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  180. return srv.(LockServer).Unlock(ctx, req.(*UnlockRequest))
  181. }
  182. return interceptor(ctx, in, info, handler)
  183. }
  184. var _Lock_serviceDesc = grpc.ServiceDesc{
  185. ServiceName: "v3lockpb.Lock",
  186. HandlerType: (*LockServer)(nil),
  187. Methods: []grpc.MethodDesc{
  188. {
  189. MethodName: "Lock",
  190. Handler: _Lock_Lock_Handler,
  191. },
  192. {
  193. MethodName: "Unlock",
  194. Handler: _Lock_Unlock_Handler,
  195. },
  196. },
  197. Streams: []grpc.StreamDesc{},
  198. Metadata: "v3lock.proto",
  199. }
  200. func (m *LockRequest) Marshal() (dAtA []byte, err error) {
  201. size := m.Size()
  202. dAtA = make([]byte, size)
  203. n, err := m.MarshalTo(dAtA)
  204. if err != nil {
  205. return nil, err
  206. }
  207. return dAtA[:n], nil
  208. }
  209. func (m *LockRequest) MarshalTo(dAtA []byte) (int, error) {
  210. var i int
  211. _ = i
  212. var l int
  213. _ = l
  214. if len(m.Name) > 0 {
  215. dAtA[i] = 0xa
  216. i++
  217. i = encodeVarintV3Lock(dAtA, i, uint64(len(m.Name)))
  218. i += copy(dAtA[i:], m.Name)
  219. }
  220. if m.Lease != 0 {
  221. dAtA[i] = 0x10
  222. i++
  223. i = encodeVarintV3Lock(dAtA, i, uint64(m.Lease))
  224. }
  225. return i, nil
  226. }
  227. func (m *LockResponse) Marshal() (dAtA []byte, err error) {
  228. size := m.Size()
  229. dAtA = make([]byte, size)
  230. n, err := m.MarshalTo(dAtA)
  231. if err != nil {
  232. return nil, err
  233. }
  234. return dAtA[:n], nil
  235. }
  236. func (m *LockResponse) MarshalTo(dAtA []byte) (int, error) {
  237. var i int
  238. _ = i
  239. var l int
  240. _ = l
  241. if m.Header != nil {
  242. dAtA[i] = 0xa
  243. i++
  244. i = encodeVarintV3Lock(dAtA, i, uint64(m.Header.Size()))
  245. n1, err := m.Header.MarshalTo(dAtA[i:])
  246. if err != nil {
  247. return 0, err
  248. }
  249. i += n1
  250. }
  251. if len(m.Key) > 0 {
  252. dAtA[i] = 0x12
  253. i++
  254. i = encodeVarintV3Lock(dAtA, i, uint64(len(m.Key)))
  255. i += copy(dAtA[i:], m.Key)
  256. }
  257. return i, nil
  258. }
  259. func (m *UnlockRequest) Marshal() (dAtA []byte, err error) {
  260. size := m.Size()
  261. dAtA = make([]byte, size)
  262. n, err := m.MarshalTo(dAtA)
  263. if err != nil {
  264. return nil, err
  265. }
  266. return dAtA[:n], nil
  267. }
  268. func (m *UnlockRequest) MarshalTo(dAtA []byte) (int, error) {
  269. var i int
  270. _ = i
  271. var l int
  272. _ = l
  273. if len(m.Key) > 0 {
  274. dAtA[i] = 0xa
  275. i++
  276. i = encodeVarintV3Lock(dAtA, i, uint64(len(m.Key)))
  277. i += copy(dAtA[i:], m.Key)
  278. }
  279. return i, nil
  280. }
  281. func (m *UnlockResponse) Marshal() (dAtA []byte, err error) {
  282. size := m.Size()
  283. dAtA = make([]byte, size)
  284. n, err := m.MarshalTo(dAtA)
  285. if err != nil {
  286. return nil, err
  287. }
  288. return dAtA[:n], nil
  289. }
  290. func (m *UnlockResponse) MarshalTo(dAtA []byte) (int, error) {
  291. var i int
  292. _ = i
  293. var l int
  294. _ = l
  295. if m.Header != nil {
  296. dAtA[i] = 0xa
  297. i++
  298. i = encodeVarintV3Lock(dAtA, i, uint64(m.Header.Size()))
  299. n2, err := m.Header.MarshalTo(dAtA[i:])
  300. if err != nil {
  301. return 0, err
  302. }
  303. i += n2
  304. }
  305. return i, nil
  306. }
  307. func encodeFixed64V3Lock(dAtA []byte, offset int, v uint64) int {
  308. dAtA[offset] = uint8(v)
  309. dAtA[offset+1] = uint8(v >> 8)
  310. dAtA[offset+2] = uint8(v >> 16)
  311. dAtA[offset+3] = uint8(v >> 24)
  312. dAtA[offset+4] = uint8(v >> 32)
  313. dAtA[offset+5] = uint8(v >> 40)
  314. dAtA[offset+6] = uint8(v >> 48)
  315. dAtA[offset+7] = uint8(v >> 56)
  316. return offset + 8
  317. }
  318. func encodeFixed32V3Lock(dAtA []byte, offset int, v uint32) int {
  319. dAtA[offset] = uint8(v)
  320. dAtA[offset+1] = uint8(v >> 8)
  321. dAtA[offset+2] = uint8(v >> 16)
  322. dAtA[offset+3] = uint8(v >> 24)
  323. return offset + 4
  324. }
  325. func encodeVarintV3Lock(dAtA []byte, offset int, v uint64) int {
  326. for v >= 1<<7 {
  327. dAtA[offset] = uint8(v&0x7f | 0x80)
  328. v >>= 7
  329. offset++
  330. }
  331. dAtA[offset] = uint8(v)
  332. return offset + 1
  333. }
  334. func (m *LockRequest) Size() (n int) {
  335. var l int
  336. _ = l
  337. l = len(m.Name)
  338. if l > 0 {
  339. n += 1 + l + sovV3Lock(uint64(l))
  340. }
  341. if m.Lease != 0 {
  342. n += 1 + sovV3Lock(uint64(m.Lease))
  343. }
  344. return n
  345. }
  346. func (m *LockResponse) Size() (n int) {
  347. var l int
  348. _ = l
  349. if m.Header != nil {
  350. l = m.Header.Size()
  351. n += 1 + l + sovV3Lock(uint64(l))
  352. }
  353. l = len(m.Key)
  354. if l > 0 {
  355. n += 1 + l + sovV3Lock(uint64(l))
  356. }
  357. return n
  358. }
  359. func (m *UnlockRequest) Size() (n int) {
  360. var l int
  361. _ = l
  362. l = len(m.Key)
  363. if l > 0 {
  364. n += 1 + l + sovV3Lock(uint64(l))
  365. }
  366. return n
  367. }
  368. func (m *UnlockResponse) Size() (n int) {
  369. var l int
  370. _ = l
  371. if m.Header != nil {
  372. l = m.Header.Size()
  373. n += 1 + l + sovV3Lock(uint64(l))
  374. }
  375. return n
  376. }
  377. func sovV3Lock(x uint64) (n int) {
  378. for {
  379. n++
  380. x >>= 7
  381. if x == 0 {
  382. break
  383. }
  384. }
  385. return n
  386. }
  387. func sozV3Lock(x uint64) (n int) {
  388. return sovV3Lock(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  389. }
  390. func (m *LockRequest) Unmarshal(dAtA []byte) error {
  391. l := len(dAtA)
  392. iNdEx := 0
  393. for iNdEx < l {
  394. preIndex := iNdEx
  395. var wire uint64
  396. for shift := uint(0); ; shift += 7 {
  397. if shift >= 64 {
  398. return ErrIntOverflowV3Lock
  399. }
  400. if iNdEx >= l {
  401. return io.ErrUnexpectedEOF
  402. }
  403. b := dAtA[iNdEx]
  404. iNdEx++
  405. wire |= (uint64(b) & 0x7F) << shift
  406. if b < 0x80 {
  407. break
  408. }
  409. }
  410. fieldNum := int32(wire >> 3)
  411. wireType := int(wire & 0x7)
  412. if wireType == 4 {
  413. return fmt.Errorf("proto: LockRequest: wiretype end group for non-group")
  414. }
  415. if fieldNum <= 0 {
  416. return fmt.Errorf("proto: LockRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  417. }
  418. switch fieldNum {
  419. case 1:
  420. if wireType != 2 {
  421. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  422. }
  423. var byteLen int
  424. for shift := uint(0); ; shift += 7 {
  425. if shift >= 64 {
  426. return ErrIntOverflowV3Lock
  427. }
  428. if iNdEx >= l {
  429. return io.ErrUnexpectedEOF
  430. }
  431. b := dAtA[iNdEx]
  432. iNdEx++
  433. byteLen |= (int(b) & 0x7F) << shift
  434. if b < 0x80 {
  435. break
  436. }
  437. }
  438. if byteLen < 0 {
  439. return ErrInvalidLengthV3Lock
  440. }
  441. postIndex := iNdEx + byteLen
  442. if postIndex > l {
  443. return io.ErrUnexpectedEOF
  444. }
  445. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  446. if m.Name == nil {
  447. m.Name = []byte{}
  448. }
  449. iNdEx = postIndex
  450. case 2:
  451. if wireType != 0 {
  452. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  453. }
  454. m.Lease = 0
  455. for shift := uint(0); ; shift += 7 {
  456. if shift >= 64 {
  457. return ErrIntOverflowV3Lock
  458. }
  459. if iNdEx >= l {
  460. return io.ErrUnexpectedEOF
  461. }
  462. b := dAtA[iNdEx]
  463. iNdEx++
  464. m.Lease |= (int64(b) & 0x7F) << shift
  465. if b < 0x80 {
  466. break
  467. }
  468. }
  469. default:
  470. iNdEx = preIndex
  471. skippy, err := skipV3Lock(dAtA[iNdEx:])
  472. if err != nil {
  473. return err
  474. }
  475. if skippy < 0 {
  476. return ErrInvalidLengthV3Lock
  477. }
  478. if (iNdEx + skippy) > l {
  479. return io.ErrUnexpectedEOF
  480. }
  481. iNdEx += skippy
  482. }
  483. }
  484. if iNdEx > l {
  485. return io.ErrUnexpectedEOF
  486. }
  487. return nil
  488. }
  489. func (m *LockResponse) Unmarshal(dAtA []byte) error {
  490. l := len(dAtA)
  491. iNdEx := 0
  492. for iNdEx < l {
  493. preIndex := iNdEx
  494. var wire uint64
  495. for shift := uint(0); ; shift += 7 {
  496. if shift >= 64 {
  497. return ErrIntOverflowV3Lock
  498. }
  499. if iNdEx >= l {
  500. return io.ErrUnexpectedEOF
  501. }
  502. b := dAtA[iNdEx]
  503. iNdEx++
  504. wire |= (uint64(b) & 0x7F) << shift
  505. if b < 0x80 {
  506. break
  507. }
  508. }
  509. fieldNum := int32(wire >> 3)
  510. wireType := int(wire & 0x7)
  511. if wireType == 4 {
  512. return fmt.Errorf("proto: LockResponse: wiretype end group for non-group")
  513. }
  514. if fieldNum <= 0 {
  515. return fmt.Errorf("proto: LockResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  516. }
  517. switch fieldNum {
  518. case 1:
  519. if wireType != 2 {
  520. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  521. }
  522. var msglen int
  523. for shift := uint(0); ; shift += 7 {
  524. if shift >= 64 {
  525. return ErrIntOverflowV3Lock
  526. }
  527. if iNdEx >= l {
  528. return io.ErrUnexpectedEOF
  529. }
  530. b := dAtA[iNdEx]
  531. iNdEx++
  532. msglen |= (int(b) & 0x7F) << shift
  533. if b < 0x80 {
  534. break
  535. }
  536. }
  537. if msglen < 0 {
  538. return ErrInvalidLengthV3Lock
  539. }
  540. postIndex := iNdEx + msglen
  541. if postIndex > l {
  542. return io.ErrUnexpectedEOF
  543. }
  544. if m.Header == nil {
  545. m.Header = &etcdserverpb.ResponseHeader{}
  546. }
  547. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  548. return err
  549. }
  550. iNdEx = postIndex
  551. case 2:
  552. if wireType != 2 {
  553. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  554. }
  555. var byteLen int
  556. for shift := uint(0); ; shift += 7 {
  557. if shift >= 64 {
  558. return ErrIntOverflowV3Lock
  559. }
  560. if iNdEx >= l {
  561. return io.ErrUnexpectedEOF
  562. }
  563. b := dAtA[iNdEx]
  564. iNdEx++
  565. byteLen |= (int(b) & 0x7F) << shift
  566. if b < 0x80 {
  567. break
  568. }
  569. }
  570. if byteLen < 0 {
  571. return ErrInvalidLengthV3Lock
  572. }
  573. postIndex := iNdEx + byteLen
  574. if postIndex > l {
  575. return io.ErrUnexpectedEOF
  576. }
  577. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  578. if m.Key == nil {
  579. m.Key = []byte{}
  580. }
  581. iNdEx = postIndex
  582. default:
  583. iNdEx = preIndex
  584. skippy, err := skipV3Lock(dAtA[iNdEx:])
  585. if err != nil {
  586. return err
  587. }
  588. if skippy < 0 {
  589. return ErrInvalidLengthV3Lock
  590. }
  591. if (iNdEx + skippy) > l {
  592. return io.ErrUnexpectedEOF
  593. }
  594. iNdEx += skippy
  595. }
  596. }
  597. if iNdEx > l {
  598. return io.ErrUnexpectedEOF
  599. }
  600. return nil
  601. }
  602. func (m *UnlockRequest) Unmarshal(dAtA []byte) error {
  603. l := len(dAtA)
  604. iNdEx := 0
  605. for iNdEx < l {
  606. preIndex := iNdEx
  607. var wire uint64
  608. for shift := uint(0); ; shift += 7 {
  609. if shift >= 64 {
  610. return ErrIntOverflowV3Lock
  611. }
  612. if iNdEx >= l {
  613. return io.ErrUnexpectedEOF
  614. }
  615. b := dAtA[iNdEx]
  616. iNdEx++
  617. wire |= (uint64(b) & 0x7F) << shift
  618. if b < 0x80 {
  619. break
  620. }
  621. }
  622. fieldNum := int32(wire >> 3)
  623. wireType := int(wire & 0x7)
  624. if wireType == 4 {
  625. return fmt.Errorf("proto: UnlockRequest: wiretype end group for non-group")
  626. }
  627. if fieldNum <= 0 {
  628. return fmt.Errorf("proto: UnlockRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  629. }
  630. switch fieldNum {
  631. case 1:
  632. if wireType != 2 {
  633. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  634. }
  635. var byteLen int
  636. for shift := uint(0); ; shift += 7 {
  637. if shift >= 64 {
  638. return ErrIntOverflowV3Lock
  639. }
  640. if iNdEx >= l {
  641. return io.ErrUnexpectedEOF
  642. }
  643. b := dAtA[iNdEx]
  644. iNdEx++
  645. byteLen |= (int(b) & 0x7F) << shift
  646. if b < 0x80 {
  647. break
  648. }
  649. }
  650. if byteLen < 0 {
  651. return ErrInvalidLengthV3Lock
  652. }
  653. postIndex := iNdEx + byteLen
  654. if postIndex > l {
  655. return io.ErrUnexpectedEOF
  656. }
  657. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  658. if m.Key == nil {
  659. m.Key = []byte{}
  660. }
  661. iNdEx = postIndex
  662. default:
  663. iNdEx = preIndex
  664. skippy, err := skipV3Lock(dAtA[iNdEx:])
  665. if err != nil {
  666. return err
  667. }
  668. if skippy < 0 {
  669. return ErrInvalidLengthV3Lock
  670. }
  671. if (iNdEx + skippy) > l {
  672. return io.ErrUnexpectedEOF
  673. }
  674. iNdEx += skippy
  675. }
  676. }
  677. if iNdEx > l {
  678. return io.ErrUnexpectedEOF
  679. }
  680. return nil
  681. }
  682. func (m *UnlockResponse) Unmarshal(dAtA []byte) error {
  683. l := len(dAtA)
  684. iNdEx := 0
  685. for iNdEx < l {
  686. preIndex := iNdEx
  687. var wire uint64
  688. for shift := uint(0); ; shift += 7 {
  689. if shift >= 64 {
  690. return ErrIntOverflowV3Lock
  691. }
  692. if iNdEx >= l {
  693. return io.ErrUnexpectedEOF
  694. }
  695. b := dAtA[iNdEx]
  696. iNdEx++
  697. wire |= (uint64(b) & 0x7F) << shift
  698. if b < 0x80 {
  699. break
  700. }
  701. }
  702. fieldNum := int32(wire >> 3)
  703. wireType := int(wire & 0x7)
  704. if wireType == 4 {
  705. return fmt.Errorf("proto: UnlockResponse: wiretype end group for non-group")
  706. }
  707. if fieldNum <= 0 {
  708. return fmt.Errorf("proto: UnlockResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  709. }
  710. switch fieldNum {
  711. case 1:
  712. if wireType != 2 {
  713. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  714. }
  715. var msglen int
  716. for shift := uint(0); ; shift += 7 {
  717. if shift >= 64 {
  718. return ErrIntOverflowV3Lock
  719. }
  720. if iNdEx >= l {
  721. return io.ErrUnexpectedEOF
  722. }
  723. b := dAtA[iNdEx]
  724. iNdEx++
  725. msglen |= (int(b) & 0x7F) << shift
  726. if b < 0x80 {
  727. break
  728. }
  729. }
  730. if msglen < 0 {
  731. return ErrInvalidLengthV3Lock
  732. }
  733. postIndex := iNdEx + msglen
  734. if postIndex > l {
  735. return io.ErrUnexpectedEOF
  736. }
  737. if m.Header == nil {
  738. m.Header = &etcdserverpb.ResponseHeader{}
  739. }
  740. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  741. return err
  742. }
  743. iNdEx = postIndex
  744. default:
  745. iNdEx = preIndex
  746. skippy, err := skipV3Lock(dAtA[iNdEx:])
  747. if err != nil {
  748. return err
  749. }
  750. if skippy < 0 {
  751. return ErrInvalidLengthV3Lock
  752. }
  753. if (iNdEx + skippy) > l {
  754. return io.ErrUnexpectedEOF
  755. }
  756. iNdEx += skippy
  757. }
  758. }
  759. if iNdEx > l {
  760. return io.ErrUnexpectedEOF
  761. }
  762. return nil
  763. }
  764. func skipV3Lock(dAtA []byte) (n int, err error) {
  765. l := len(dAtA)
  766. iNdEx := 0
  767. for iNdEx < l {
  768. var wire uint64
  769. for shift := uint(0); ; shift += 7 {
  770. if shift >= 64 {
  771. return 0, ErrIntOverflowV3Lock
  772. }
  773. if iNdEx >= l {
  774. return 0, io.ErrUnexpectedEOF
  775. }
  776. b := dAtA[iNdEx]
  777. iNdEx++
  778. wire |= (uint64(b) & 0x7F) << shift
  779. if b < 0x80 {
  780. break
  781. }
  782. }
  783. wireType := int(wire & 0x7)
  784. switch wireType {
  785. case 0:
  786. for shift := uint(0); ; shift += 7 {
  787. if shift >= 64 {
  788. return 0, ErrIntOverflowV3Lock
  789. }
  790. if iNdEx >= l {
  791. return 0, io.ErrUnexpectedEOF
  792. }
  793. iNdEx++
  794. if dAtA[iNdEx-1] < 0x80 {
  795. break
  796. }
  797. }
  798. return iNdEx, nil
  799. case 1:
  800. iNdEx += 8
  801. return iNdEx, nil
  802. case 2:
  803. var length int
  804. for shift := uint(0); ; shift += 7 {
  805. if shift >= 64 {
  806. return 0, ErrIntOverflowV3Lock
  807. }
  808. if iNdEx >= l {
  809. return 0, io.ErrUnexpectedEOF
  810. }
  811. b := dAtA[iNdEx]
  812. iNdEx++
  813. length |= (int(b) & 0x7F) << shift
  814. if b < 0x80 {
  815. break
  816. }
  817. }
  818. iNdEx += length
  819. if length < 0 {
  820. return 0, ErrInvalidLengthV3Lock
  821. }
  822. return iNdEx, nil
  823. case 3:
  824. for {
  825. var innerWire uint64
  826. var start int = iNdEx
  827. for shift := uint(0); ; shift += 7 {
  828. if shift >= 64 {
  829. return 0, ErrIntOverflowV3Lock
  830. }
  831. if iNdEx >= l {
  832. return 0, io.ErrUnexpectedEOF
  833. }
  834. b := dAtA[iNdEx]
  835. iNdEx++
  836. innerWire |= (uint64(b) & 0x7F) << shift
  837. if b < 0x80 {
  838. break
  839. }
  840. }
  841. innerWireType := int(innerWire & 0x7)
  842. if innerWireType == 4 {
  843. break
  844. }
  845. next, err := skipV3Lock(dAtA[start:])
  846. if err != nil {
  847. return 0, err
  848. }
  849. iNdEx = start + next
  850. }
  851. return iNdEx, nil
  852. case 4:
  853. return iNdEx, nil
  854. case 5:
  855. iNdEx += 4
  856. return iNdEx, nil
  857. default:
  858. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  859. }
  860. }
  861. panic("unreachable")
  862. }
  863. var (
  864. ErrInvalidLengthV3Lock = fmt.Errorf("proto: negative length found during unmarshaling")
  865. ErrIntOverflowV3Lock = fmt.Errorf("proto: integer overflow")
  866. )
  867. func init() { proto.RegisterFile("v3lock.proto", fileDescriptorV3Lock) }
  868. var fileDescriptorV3Lock = []byte{
  869. // 336 bytes of a gzipped FileDescriptorProto
  870. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x33, 0xce, 0xc9,
  871. 0x4f, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf0, 0x0a, 0x92, 0xa4, 0x44,
  872. 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x82, 0xfa, 0x20, 0x16, 0x44, 0x5e, 0x4a, 0x2d, 0xb5, 0x24, 0x39,
  873. 0x45, 0x1f, 0x44, 0x14, 0xa7, 0x16, 0x95, 0xa5, 0x16, 0x21, 0x31, 0x0b, 0x92, 0xf4, 0x8b, 0x0a,
  874. 0x92, 0xa1, 0xea, 0x64, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0x13, 0x0b, 0x32, 0xf5, 0x13,
  875. 0xf3, 0xf2, 0xf2, 0x4b, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0x8a, 0x21, 0xb2, 0x4a, 0xe6, 0x5c, 0xdc,
  876. 0x3e, 0xf9, 0xc9, 0xd9, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x42, 0x5c, 0x2c, 0x79,
  877. 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x08, 0x17, 0x6b,
  878. 0x4e, 0x6a, 0x62, 0x71, 0xaa, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x73, 0x10, 0x84, 0xa3, 0x14, 0xc6,
  879. 0xc5, 0x03, 0xd1, 0x58, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0x64, 0xc2, 0xc5, 0x96, 0x91, 0x9a,
  880. 0x98, 0x92, 0x5a, 0x04, 0xd6, 0xcb, 0x6d, 0x24, 0xa3, 0x87, 0xec, 0x1e, 0x3d, 0x98, 0x3a, 0x0f,
  881. 0xb0, 0x9a, 0x20, 0xa8, 0x5a, 0x21, 0x01, 0x2e, 0xe6, 0xec, 0xd4, 0x4a, 0xb0, 0xc9, 0x3c, 0x41,
  882. 0x20, 0xa6, 0x92, 0x22, 0x17, 0x6f, 0x68, 0x5e, 0x0e, 0x92, 0x93, 0xa0, 0x4a, 0x18, 0x11, 0x4a,
  883. 0xdc, 0xb8, 0xf8, 0x60, 0x4a, 0x28, 0xb1, 0xdc, 0x68, 0x17, 0x23, 0x17, 0x0b, 0xc8, 0x0f, 0x42,
  884. 0x21, 0x50, 0x5a, 0x54, 0x0f, 0x16, 0xe6, 0x7a, 0x48, 0x81, 0x22, 0x25, 0x86, 0x2e, 0x0c, 0x31,
  885. 0x4d, 0x49, 0xb6, 0xe9, 0xf2, 0x93, 0xc9, 0x4c, 0xe2, 0x4a, 0x42, 0xfa, 0x65, 0xc6, 0x89, 0x39,
  886. 0x05, 0x19, 0x89, 0xfa, 0x20, 0x55, 0x60, 0xc2, 0x8a, 0x51, 0x4b, 0x28, 0x86, 0x8b, 0x0d, 0xe2,
  887. 0x4c, 0x21, 0x71, 0x84, 0x01, 0x28, 0x7e, 0x93, 0x92, 0xc0, 0x94, 0x80, 0x9a, 0x2d, 0x0f, 0x36,
  888. 0x5b, 0x52, 0x49, 0x04, 0xd5, 0xec, 0xd2, 0x3c, 0xa8, 0xe9, 0x4e, 0x02, 0x27, 0x1e, 0xc9, 0x31,
  889. 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x49, 0x6c, 0xe0,
  890. 0x18, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xa0, 0x26, 0x28, 0x47, 0x02, 0x00, 0x00,
  891. }