v3lock.pb.go 23 KB

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