import "go.etcd.io/etcd/etcdserver/api/v3lock/v3lockpb"
Package v3lockpb is a generated protocol buffer package.
It is generated from these files:
v3lock.proto
It has these top-level messages:
LockRequest LockResponse UnlockRequest UnlockResponse
var ( ErrInvalidLengthV3Lock = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowV3Lock = fmt.Errorf("proto: integer overflow") )
func RegisterLockServer(s *grpc.Server, srv LockServer)
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(cc *grpc.ClientConn) LockClient
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 acquisition; 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() ([]byte, []int)
func (m *LockRequest) GetLease() int64
func (m *LockRequest) GetName() []byte
func (m *LockRequest) Marshal() (dAtA []byte, err error)
func (m *LockRequest) MarshalTo(dAtA []byte) (int, error)
func (*LockRequest) ProtoMessage()
func (m *LockRequest) Reset()
func (m *LockRequest) Size() (n int)
func (m *LockRequest) String() string
func (m *LockRequest) Unmarshal(dAtA []byte) error
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() ([]byte, []int)
func (m *LockResponse) GetHeader() *etcdserverpb.ResponseHeader
func (m *LockResponse) GetKey() []byte
func (m *LockResponse) Marshal() (dAtA []byte, err error)
func (m *LockResponse) MarshalTo(dAtA []byte) (int, error)
func (*LockResponse) ProtoMessage()
func (m *LockResponse) Reset()
func (m *LockResponse) Size() (n int)
func (m *LockResponse) String() string
func (m *LockResponse) Unmarshal(dAtA []byte) error
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 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() ([]byte, []int)
func (m *UnlockRequest) GetKey() []byte
func (m *UnlockRequest) Marshal() (dAtA []byte, err error)
func (m *UnlockRequest) MarshalTo(dAtA []byte) (int, error)
func (*UnlockRequest) ProtoMessage()
func (m *UnlockRequest) Reset()
func (m *UnlockRequest) Size() (n int)
func (m *UnlockRequest) String() string
func (m *UnlockRequest) Unmarshal(dAtA []byte) error
type UnlockResponse struct { Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` }
func (*UnlockResponse) Descriptor() ([]byte, []int)
func (m *UnlockResponse) GetHeader() *etcdserverpb.ResponseHeader
func (m *UnlockResponse) Marshal() (dAtA []byte, err error)
func (m *UnlockResponse) MarshalTo(dAtA []byte) (int, error)
func (*UnlockResponse) ProtoMessage()
func (m *UnlockResponse) Reset()
func (m *UnlockResponse) Size() (n int)
func (m *UnlockResponse) String() string
func (m *UnlockResponse) Unmarshal(dAtA []byte) error
Path | Synopsis |
---|---|
gw | Package v3lockpb is a reverse proxy. |
Package v3lockpb imports 8 packages (graph) and is imported by 57 packages. Updated 2018-08-29. Refresh now. Tools for package owners.