v3lock.pb.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  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. 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 encodeFixed64V3Lock(dAtA []byte, offset int, v uint64) int {
  332. dAtA[offset] = uint8(v)
  333. dAtA[offset+1] = uint8(v >> 8)
  334. dAtA[offset+2] = uint8(v >> 16)
  335. dAtA[offset+3] = uint8(v >> 24)
  336. dAtA[offset+4] = uint8(v >> 32)
  337. dAtA[offset+5] = uint8(v >> 40)
  338. dAtA[offset+6] = uint8(v >> 48)
  339. dAtA[offset+7] = uint8(v >> 56)
  340. return offset + 8
  341. }
  342. func encodeFixed32V3Lock(dAtA []byte, offset int, v uint32) int {
  343. dAtA[offset] = uint8(v)
  344. dAtA[offset+1] = uint8(v >> 8)
  345. dAtA[offset+2] = uint8(v >> 16)
  346. dAtA[offset+3] = uint8(v >> 24)
  347. return offset + 4
  348. }
  349. func encodeVarintV3Lock(dAtA []byte, offset int, v uint64) int {
  350. for v >= 1<<7 {
  351. dAtA[offset] = uint8(v&0x7f | 0x80)
  352. v >>= 7
  353. offset++
  354. }
  355. dAtA[offset] = uint8(v)
  356. return offset + 1
  357. }
  358. func (m *LockRequest) Size() (n int) {
  359. var l int
  360. _ = l
  361. l = len(m.Name)
  362. if l > 0 {
  363. n += 1 + l + sovV3Lock(uint64(l))
  364. }
  365. if m.Lease != 0 {
  366. n += 1 + sovV3Lock(uint64(m.Lease))
  367. }
  368. return n
  369. }
  370. func (m *LockResponse) Size() (n int) {
  371. var l int
  372. _ = l
  373. if m.Header != nil {
  374. l = m.Header.Size()
  375. n += 1 + l + sovV3Lock(uint64(l))
  376. }
  377. l = len(m.Key)
  378. if l > 0 {
  379. n += 1 + l + sovV3Lock(uint64(l))
  380. }
  381. return n
  382. }
  383. func (m *UnlockRequest) Size() (n int) {
  384. var l int
  385. _ = l
  386. l = len(m.Key)
  387. if l > 0 {
  388. n += 1 + l + sovV3Lock(uint64(l))
  389. }
  390. return n
  391. }
  392. func (m *UnlockResponse) Size() (n int) {
  393. var l int
  394. _ = l
  395. if m.Header != nil {
  396. l = m.Header.Size()
  397. n += 1 + l + sovV3Lock(uint64(l))
  398. }
  399. return n
  400. }
  401. func sovV3Lock(x uint64) (n int) {
  402. for {
  403. n++
  404. x >>= 7
  405. if x == 0 {
  406. break
  407. }
  408. }
  409. return n
  410. }
  411. func sozV3Lock(x uint64) (n int) {
  412. return sovV3Lock(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  413. }
  414. func (m *LockRequest) Unmarshal(dAtA []byte) error {
  415. l := len(dAtA)
  416. iNdEx := 0
  417. for iNdEx < l {
  418. preIndex := iNdEx
  419. var wire uint64
  420. for shift := uint(0); ; shift += 7 {
  421. if shift >= 64 {
  422. return ErrIntOverflowV3Lock
  423. }
  424. if iNdEx >= l {
  425. return io.ErrUnexpectedEOF
  426. }
  427. b := dAtA[iNdEx]
  428. iNdEx++
  429. wire |= (uint64(b) & 0x7F) << shift
  430. if b < 0x80 {
  431. break
  432. }
  433. }
  434. fieldNum := int32(wire >> 3)
  435. wireType := int(wire & 0x7)
  436. if wireType == 4 {
  437. return fmt.Errorf("proto: LockRequest: wiretype end group for non-group")
  438. }
  439. if fieldNum <= 0 {
  440. return fmt.Errorf("proto: LockRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  441. }
  442. switch fieldNum {
  443. case 1:
  444. if wireType != 2 {
  445. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  446. }
  447. var byteLen int
  448. for shift := uint(0); ; shift += 7 {
  449. if shift >= 64 {
  450. return ErrIntOverflowV3Lock
  451. }
  452. if iNdEx >= l {
  453. return io.ErrUnexpectedEOF
  454. }
  455. b := dAtA[iNdEx]
  456. iNdEx++
  457. byteLen |= (int(b) & 0x7F) << shift
  458. if b < 0x80 {
  459. break
  460. }
  461. }
  462. if byteLen < 0 {
  463. return ErrInvalidLengthV3Lock
  464. }
  465. postIndex := iNdEx + byteLen
  466. if postIndex > l {
  467. return io.ErrUnexpectedEOF
  468. }
  469. m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
  470. if m.Name == nil {
  471. m.Name = []byte{}
  472. }
  473. iNdEx = postIndex
  474. case 2:
  475. if wireType != 0 {
  476. return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
  477. }
  478. m.Lease = 0
  479. for shift := uint(0); ; shift += 7 {
  480. if shift >= 64 {
  481. return ErrIntOverflowV3Lock
  482. }
  483. if iNdEx >= l {
  484. return io.ErrUnexpectedEOF
  485. }
  486. b := dAtA[iNdEx]
  487. iNdEx++
  488. m.Lease |= (int64(b) & 0x7F) << shift
  489. if b < 0x80 {
  490. break
  491. }
  492. }
  493. default:
  494. iNdEx = preIndex
  495. skippy, err := skipV3Lock(dAtA[iNdEx:])
  496. if err != nil {
  497. return err
  498. }
  499. if skippy < 0 {
  500. return ErrInvalidLengthV3Lock
  501. }
  502. if (iNdEx + skippy) > l {
  503. return io.ErrUnexpectedEOF
  504. }
  505. iNdEx += skippy
  506. }
  507. }
  508. if iNdEx > l {
  509. return io.ErrUnexpectedEOF
  510. }
  511. return nil
  512. }
  513. func (m *LockResponse) Unmarshal(dAtA []byte) error {
  514. l := len(dAtA)
  515. iNdEx := 0
  516. for iNdEx < l {
  517. preIndex := iNdEx
  518. var wire uint64
  519. for shift := uint(0); ; shift += 7 {
  520. if shift >= 64 {
  521. return ErrIntOverflowV3Lock
  522. }
  523. if iNdEx >= l {
  524. return io.ErrUnexpectedEOF
  525. }
  526. b := dAtA[iNdEx]
  527. iNdEx++
  528. wire |= (uint64(b) & 0x7F) << shift
  529. if b < 0x80 {
  530. break
  531. }
  532. }
  533. fieldNum := int32(wire >> 3)
  534. wireType := int(wire & 0x7)
  535. if wireType == 4 {
  536. return fmt.Errorf("proto: LockResponse: wiretype end group for non-group")
  537. }
  538. if fieldNum <= 0 {
  539. return fmt.Errorf("proto: LockResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  540. }
  541. switch fieldNum {
  542. case 1:
  543. if wireType != 2 {
  544. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  545. }
  546. var msglen int
  547. for shift := uint(0); ; shift += 7 {
  548. if shift >= 64 {
  549. return ErrIntOverflowV3Lock
  550. }
  551. if iNdEx >= l {
  552. return io.ErrUnexpectedEOF
  553. }
  554. b := dAtA[iNdEx]
  555. iNdEx++
  556. msglen |= (int(b) & 0x7F) << shift
  557. if b < 0x80 {
  558. break
  559. }
  560. }
  561. if msglen < 0 {
  562. return ErrInvalidLengthV3Lock
  563. }
  564. postIndex := iNdEx + msglen
  565. if postIndex > l {
  566. return io.ErrUnexpectedEOF
  567. }
  568. if m.Header == nil {
  569. m.Header = &etcdserverpb.ResponseHeader{}
  570. }
  571. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  572. return err
  573. }
  574. iNdEx = postIndex
  575. case 2:
  576. if wireType != 2 {
  577. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  578. }
  579. var byteLen int
  580. for shift := uint(0); ; shift += 7 {
  581. if shift >= 64 {
  582. return ErrIntOverflowV3Lock
  583. }
  584. if iNdEx >= l {
  585. return io.ErrUnexpectedEOF
  586. }
  587. b := dAtA[iNdEx]
  588. iNdEx++
  589. byteLen |= (int(b) & 0x7F) << shift
  590. if b < 0x80 {
  591. break
  592. }
  593. }
  594. if byteLen < 0 {
  595. return ErrInvalidLengthV3Lock
  596. }
  597. postIndex := iNdEx + byteLen
  598. if postIndex > l {
  599. return io.ErrUnexpectedEOF
  600. }
  601. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  602. if m.Key == nil {
  603. m.Key = []byte{}
  604. }
  605. iNdEx = postIndex
  606. default:
  607. iNdEx = preIndex
  608. skippy, err := skipV3Lock(dAtA[iNdEx:])
  609. if err != nil {
  610. return err
  611. }
  612. if skippy < 0 {
  613. return ErrInvalidLengthV3Lock
  614. }
  615. if (iNdEx + skippy) > l {
  616. return io.ErrUnexpectedEOF
  617. }
  618. iNdEx += skippy
  619. }
  620. }
  621. if iNdEx > l {
  622. return io.ErrUnexpectedEOF
  623. }
  624. return nil
  625. }
  626. func (m *UnlockRequest) Unmarshal(dAtA []byte) error {
  627. l := len(dAtA)
  628. iNdEx := 0
  629. for iNdEx < l {
  630. preIndex := iNdEx
  631. var wire uint64
  632. for shift := uint(0); ; shift += 7 {
  633. if shift >= 64 {
  634. return ErrIntOverflowV3Lock
  635. }
  636. if iNdEx >= l {
  637. return io.ErrUnexpectedEOF
  638. }
  639. b := dAtA[iNdEx]
  640. iNdEx++
  641. wire |= (uint64(b) & 0x7F) << shift
  642. if b < 0x80 {
  643. break
  644. }
  645. }
  646. fieldNum := int32(wire >> 3)
  647. wireType := int(wire & 0x7)
  648. if wireType == 4 {
  649. return fmt.Errorf("proto: UnlockRequest: wiretype end group for non-group")
  650. }
  651. if fieldNum <= 0 {
  652. return fmt.Errorf("proto: UnlockRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  653. }
  654. switch fieldNum {
  655. case 1:
  656. if wireType != 2 {
  657. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  658. }
  659. var byteLen int
  660. for shift := uint(0); ; shift += 7 {
  661. if shift >= 64 {
  662. return ErrIntOverflowV3Lock
  663. }
  664. if iNdEx >= l {
  665. return io.ErrUnexpectedEOF
  666. }
  667. b := dAtA[iNdEx]
  668. iNdEx++
  669. byteLen |= (int(b) & 0x7F) << shift
  670. if b < 0x80 {
  671. break
  672. }
  673. }
  674. if byteLen < 0 {
  675. return ErrInvalidLengthV3Lock
  676. }
  677. postIndex := iNdEx + byteLen
  678. if postIndex > l {
  679. return io.ErrUnexpectedEOF
  680. }
  681. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  682. if m.Key == nil {
  683. m.Key = []byte{}
  684. }
  685. iNdEx = postIndex
  686. default:
  687. iNdEx = preIndex
  688. skippy, err := skipV3Lock(dAtA[iNdEx:])
  689. if err != nil {
  690. return err
  691. }
  692. if skippy < 0 {
  693. return ErrInvalidLengthV3Lock
  694. }
  695. if (iNdEx + skippy) > l {
  696. return io.ErrUnexpectedEOF
  697. }
  698. iNdEx += skippy
  699. }
  700. }
  701. if iNdEx > l {
  702. return io.ErrUnexpectedEOF
  703. }
  704. return nil
  705. }
  706. func (m *UnlockResponse) Unmarshal(dAtA []byte) error {
  707. l := len(dAtA)
  708. iNdEx := 0
  709. for iNdEx < l {
  710. preIndex := iNdEx
  711. var wire uint64
  712. for shift := uint(0); ; shift += 7 {
  713. if shift >= 64 {
  714. return ErrIntOverflowV3Lock
  715. }
  716. if iNdEx >= l {
  717. return io.ErrUnexpectedEOF
  718. }
  719. b := dAtA[iNdEx]
  720. iNdEx++
  721. wire |= (uint64(b) & 0x7F) << shift
  722. if b < 0x80 {
  723. break
  724. }
  725. }
  726. fieldNum := int32(wire >> 3)
  727. wireType := int(wire & 0x7)
  728. if wireType == 4 {
  729. return fmt.Errorf("proto: UnlockResponse: wiretype end group for non-group")
  730. }
  731. if fieldNum <= 0 {
  732. return fmt.Errorf("proto: UnlockResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  733. }
  734. switch fieldNum {
  735. case 1:
  736. if wireType != 2 {
  737. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  738. }
  739. var msglen int
  740. for shift := uint(0); ; shift += 7 {
  741. if shift >= 64 {
  742. return ErrIntOverflowV3Lock
  743. }
  744. if iNdEx >= l {
  745. return io.ErrUnexpectedEOF
  746. }
  747. b := dAtA[iNdEx]
  748. iNdEx++
  749. msglen |= (int(b) & 0x7F) << shift
  750. if b < 0x80 {
  751. break
  752. }
  753. }
  754. if msglen < 0 {
  755. return ErrInvalidLengthV3Lock
  756. }
  757. postIndex := iNdEx + msglen
  758. if postIndex > l {
  759. return io.ErrUnexpectedEOF
  760. }
  761. if m.Header == nil {
  762. m.Header = &etcdserverpb.ResponseHeader{}
  763. }
  764. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  765. return err
  766. }
  767. iNdEx = postIndex
  768. default:
  769. iNdEx = preIndex
  770. skippy, err := skipV3Lock(dAtA[iNdEx:])
  771. if err != nil {
  772. return err
  773. }
  774. if skippy < 0 {
  775. return ErrInvalidLengthV3Lock
  776. }
  777. if (iNdEx + skippy) > l {
  778. return io.ErrUnexpectedEOF
  779. }
  780. iNdEx += skippy
  781. }
  782. }
  783. if iNdEx > l {
  784. return io.ErrUnexpectedEOF
  785. }
  786. return nil
  787. }
  788. func skipV3Lock(dAtA []byte) (n int, err error) {
  789. l := len(dAtA)
  790. iNdEx := 0
  791. for iNdEx < l {
  792. var wire uint64
  793. for shift := uint(0); ; shift += 7 {
  794. if shift >= 64 {
  795. return 0, ErrIntOverflowV3Lock
  796. }
  797. if iNdEx >= l {
  798. return 0, io.ErrUnexpectedEOF
  799. }
  800. b := dAtA[iNdEx]
  801. iNdEx++
  802. wire |= (uint64(b) & 0x7F) << shift
  803. if b < 0x80 {
  804. break
  805. }
  806. }
  807. wireType := int(wire & 0x7)
  808. switch wireType {
  809. case 0:
  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. iNdEx++
  818. if dAtA[iNdEx-1] < 0x80 {
  819. break
  820. }
  821. }
  822. return iNdEx, nil
  823. case 1:
  824. iNdEx += 8
  825. return iNdEx, nil
  826. case 2:
  827. var length int
  828. for shift := uint(0); ; shift += 7 {
  829. if shift >= 64 {
  830. return 0, ErrIntOverflowV3Lock
  831. }
  832. if iNdEx >= l {
  833. return 0, io.ErrUnexpectedEOF
  834. }
  835. b := dAtA[iNdEx]
  836. iNdEx++
  837. length |= (int(b) & 0x7F) << shift
  838. if b < 0x80 {
  839. break
  840. }
  841. }
  842. iNdEx += length
  843. if length < 0 {
  844. return 0, ErrInvalidLengthV3Lock
  845. }
  846. return iNdEx, nil
  847. case 3:
  848. for {
  849. var innerWire uint64
  850. var start int = iNdEx
  851. for shift := uint(0); ; shift += 7 {
  852. if shift >= 64 {
  853. return 0, ErrIntOverflowV3Lock
  854. }
  855. if iNdEx >= l {
  856. return 0, io.ErrUnexpectedEOF
  857. }
  858. b := dAtA[iNdEx]
  859. iNdEx++
  860. innerWire |= (uint64(b) & 0x7F) << shift
  861. if b < 0x80 {
  862. break
  863. }
  864. }
  865. innerWireType := int(innerWire & 0x7)
  866. if innerWireType == 4 {
  867. break
  868. }
  869. next, err := skipV3Lock(dAtA[start:])
  870. if err != nil {
  871. return 0, err
  872. }
  873. iNdEx = start + next
  874. }
  875. return iNdEx, nil
  876. case 4:
  877. return iNdEx, nil
  878. case 5:
  879. iNdEx += 4
  880. return iNdEx, nil
  881. default:
  882. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  883. }
  884. }
  885. panic("unreachable")
  886. }
  887. var (
  888. ErrInvalidLengthV3Lock = fmt.Errorf("proto: negative length found during unmarshaling")
  889. ErrIntOverflowV3Lock = fmt.Errorf("proto: integer overflow")
  890. )
  891. func init() { proto.RegisterFile("v3lock.proto", fileDescriptorV3Lock) }
  892. var fileDescriptorV3Lock = []byte{
  893. // 336 bytes of a gzipped FileDescriptorProto
  894. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x33, 0xce, 0xc9,
  895. 0x4f, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf0, 0x0a, 0x92, 0xa4, 0x44,
  896. 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x82, 0xfa, 0x20, 0x16, 0x44, 0x5e, 0x4a, 0x2d, 0xb5, 0x24, 0x39,
  897. 0x45, 0x1f, 0x44, 0x14, 0xa7, 0x16, 0x95, 0xa5, 0x16, 0x21, 0x31, 0x0b, 0x92, 0xf4, 0x8b, 0x0a,
  898. 0x92, 0xa1, 0xea, 0x64, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0x13, 0x0b, 0x32, 0xf5, 0x13,
  899. 0xf3, 0xf2, 0xf2, 0x4b, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0x8a, 0x21, 0xb2, 0x4a, 0xe6, 0x5c, 0xdc,
  900. 0x3e, 0xf9, 0xc9, 0xd9, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x42, 0x5c, 0x2c, 0x79,
  901. 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x08, 0x17, 0x6b,
  902. 0x4e, 0x6a, 0x62, 0x71, 0xaa, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x73, 0x10, 0x84, 0xa3, 0x14, 0xc6,
  903. 0xc5, 0x03, 0xd1, 0x58, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0x64, 0xc2, 0xc5, 0x96, 0x91, 0x9a,
  904. 0x98, 0x92, 0x5a, 0x04, 0xd6, 0xcb, 0x6d, 0x24, 0xa3, 0x87, 0xec, 0x1e, 0x3d, 0x98, 0x3a, 0x0f,
  905. 0xb0, 0x9a, 0x20, 0xa8, 0x5a, 0x21, 0x01, 0x2e, 0xe6, 0xec, 0xd4, 0x4a, 0xb0, 0xc9, 0x3c, 0x41,
  906. 0x20, 0xa6, 0x92, 0x22, 0x17, 0x6f, 0x68, 0x5e, 0x0e, 0x92, 0x93, 0xa0, 0x4a, 0x18, 0x11, 0x4a,
  907. 0xdc, 0xb8, 0xf8, 0x60, 0x4a, 0x28, 0xb1, 0xdc, 0x68, 0x17, 0x23, 0x17, 0x0b, 0xc8, 0x0f, 0x42,
  908. 0x21, 0x50, 0x5a, 0x54, 0x0f, 0x16, 0xe6, 0x7a, 0x48, 0x81, 0x22, 0x25, 0x86, 0x2e, 0x0c, 0x31,
  909. 0x4d, 0x49, 0xb6, 0xe9, 0xf2, 0x93, 0xc9, 0x4c, 0xe2, 0x4a, 0x42, 0xfa, 0x65, 0xc6, 0x89, 0x39,
  910. 0x05, 0x19, 0x89, 0xfa, 0x20, 0x55, 0x60, 0xc2, 0x8a, 0x51, 0x4b, 0x28, 0x86, 0x8b, 0x0d, 0xe2,
  911. 0x4c, 0x21, 0x71, 0x84, 0x01, 0x28, 0x7e, 0x93, 0x92, 0xc0, 0x94, 0x80, 0x9a, 0x2d, 0x0f, 0x36,
  912. 0x5b, 0x52, 0x49, 0x04, 0xd5, 0xec, 0xd2, 0x3c, 0xa8, 0xe9, 0x4e, 0x02, 0x27, 0x1e, 0xc9, 0x31,
  913. 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x49, 0x6c, 0xe0,
  914. 0x18, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xa0, 0x26, 0x28, 0x47, 0x02, 0x00, 0x00,
  915. }