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