v3lock.pb.go 24 KB

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