...
Package v3lockpb
Overview ▹
Index ▹
Variables
var ( ErrInvalidLengthV3Lock = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowV3Lock = fmt.Errorf("proto: integer overflow") )
func RegisterLockServer ¶
func RegisterLockServer(s *grpc.Server, srv LockServer)
type LockClient ¶
type LockClient interface { // Lock acquires a distributed shared lock on a given named lock. // On success, it will return a unique key that exists so long as the // lock is held by the caller. This key can be used in conjunction with // transactions to safely ensure updates to etcd only occur while holding // lock ownership. The lock is held until Unlock is called on the key or the // lease associate with the owner expires. Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) // Unlock takes a key returned by Lock and releases the hold on lock. The // next Lock caller waiting for the lock will then be woken up and given // ownership of the lock. Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) }
func NewLockClient ¶
func NewLockClient(cc *grpc.ClientConn) LockClient
type LockRequest ¶
type LockRequest struct { // name is the identifier for the distributed shared lock to be acquired. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // lease is the ID of the lease that will be attached to ownership of the // lock. If the lease expires or is revoked and currently holds the lock, // the lock is automatically released. Calls to Lock with the same lease will // be treated as a single acquistion; locking twice with the same lease is a // no-op. Lease int64 `protobuf:"varint,2,opt,name=lease,proto3" json:"lease,omitempty"` }
func (*LockRequest) Descriptor ¶
func (*LockRequest) Descriptor() ([]byte, []int)
func (*LockRequest) Marshal ¶
func (m *LockRequest) Marshal() (dAtA []byte, err error)
func (*LockRequest) MarshalTo ¶
func (m *LockRequest) MarshalTo(dAtA []byte) (int, error)
func (*LockRequest) ProtoMessage ¶
func (*LockRequest) ProtoMessage()
func (*LockRequest) Reset ¶
func (m *LockRequest) Reset()
func (*LockRequest) Size ¶
func (m *LockRequest) Size() (n int)
func (*LockRequest) String ¶
func (m *LockRequest) String() string
func (*LockRequest) Unmarshal ¶
func (m *LockRequest) Unmarshal(dAtA []byte) error
type LockResponse ¶
type LockResponse struct { Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // key is a key that will exist on etcd for the duration that the Lock caller // owns the lock. Users should not modify this key or the lock may exhibit // undefined behavior. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` }
func (*LockResponse) Descriptor ¶
func (*LockResponse) Descriptor() ([]byte, []int)
func (*LockResponse) GetHeader ¶
func (m *LockResponse) GetHeader() *etcdserverpb.ResponseHeader
func (*LockResponse) Marshal ¶
func (m *LockResponse) Marshal() (dAtA []byte, err error)
func (*LockResponse) MarshalTo ¶
func (m *LockResponse) MarshalTo(dAtA []byte) (int, error)
func (*LockResponse) ProtoMessage ¶
func (*LockResponse) ProtoMessage()
func (*LockResponse) Reset ¶
func (m *LockResponse) Reset()
func (*LockResponse) Size ¶
func (m *LockResponse) Size() (n int)
func (*LockResponse) String ¶
func (m *LockResponse) String() string
func (*LockResponse) Unmarshal ¶
func (m *LockResponse) Unmarshal(dAtA []byte) error
type LockServer ¶
type LockServer interface { // Lock acquires a distributed shared lock on a given named lock. // On success, it will return a unique key that exists so long as the // lock is held by the caller. This key can be used in conjunction with // transactions to safely ensure updates to etcd only occur while holding // lock ownership. The lock is held until Unlock is called on the key or the // lease associate with the owner expires. Lock(context.Context, *LockRequest) (*LockResponse, error) // Unlock takes a key returned by Lock and releases the hold on lock. The // next Lock caller waiting for the lock will then be woken up and given // ownership of the lock. Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) }
type UnlockRequest ¶
type UnlockRequest struct {
// key is the lock ownership key granted by Lock.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}
func (*UnlockRequest) Descriptor ¶
func (*UnlockRequest) Descriptor() ([]byte, []int)
func (*UnlockRequest) Marshal ¶
func (m *UnlockRequest) Marshal() (dAtA []byte, err error)
func (*UnlockRequest) MarshalTo ¶
func (m *UnlockRequest) MarshalTo(dAtA []byte) (int, error)
func (*UnlockRequest) ProtoMessage ¶
func (*UnlockRequest) ProtoMessage()
func (*UnlockRequest) Reset ¶
func (m *UnlockRequest) Reset()
func (*UnlockRequest) Size ¶
func (m *UnlockRequest) Size() (n int)
func (*UnlockRequest) String ¶
func (m *UnlockRequest) String() string
func (*UnlockRequest) Unmarshal ¶
func (m *UnlockRequest) Unmarshal(dAtA []byte) error
type UnlockResponse ¶
type UnlockResponse struct { Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` }
func (*UnlockResponse) Descriptor ¶
func (*UnlockResponse) Descriptor() ([]byte, []int)
func (*UnlockResponse) GetHeader ¶
func (m *UnlockResponse) GetHeader() *etcdserverpb.ResponseHeader
func (*UnlockResponse) Marshal ¶
func (m *UnlockResponse) Marshal() (dAtA []byte, err error)
func (*UnlockResponse) MarshalTo ¶
func (m *UnlockResponse) MarshalTo(dAtA []byte) (int, error)
func (*UnlockResponse) ProtoMessage ¶
func (*UnlockResponse) ProtoMessage()
func (*UnlockResponse) Reset ¶
func (m *UnlockResponse) Reset()
func (*UnlockResponse) Size ¶
func (m *UnlockResponse) Size() (n int)
func (*UnlockResponse) String ¶
func (m *UnlockResponse) String() string
func (*UnlockResponse) Unmarshal ¶
func (m *UnlockResponse) Unmarshal(dAtA []byte) error