v3lockpb

package
v3.3.26+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthV3Lock = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowV3Lock   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterLockServer

func RegisterLockServer(s *grpc.Server, srv LockServer)

Types

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)
}

LockClient is the client API for Lock service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LockRequest) Descriptor

func (*LockRequest) Descriptor() ([]byte, []int)

func (*LockRequest) GetLease

func (m *LockRequest) GetLease() int64

func (*LockRequest) GetName

func (m *LockRequest) GetName() []byte

func (*LockRequest) Marshal

func (m *LockRequest) Marshal() (dAtA []byte, err error)

func (*LockRequest) MarshalTo

func (m *LockRequest) MarshalTo(dAtA []byte) (int, error)

func (*LockRequest) MarshalToSizedBuffer

func (m *LockRequest) MarshalToSizedBuffer(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

func (*LockRequest) XXX_DiscardUnknown

func (m *LockRequest) XXX_DiscardUnknown()

func (*LockRequest) XXX_Marshal

func (m *LockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LockRequest) XXX_Merge

func (m *LockRequest) XXX_Merge(src proto.Message)

func (*LockRequest) XXX_Size

func (m *LockRequest) XXX_Size() int

func (*LockRequest) XXX_Unmarshal

func (m *LockRequest) XXX_Unmarshal(b []byte) error

type LockResponse

type LockResponse struct {
	Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LockResponse) Descriptor

func (*LockResponse) Descriptor() ([]byte, []int)

func (*LockResponse) GetHeader

func (m *LockResponse) GetHeader() *etcdserverpb.ResponseHeader

func (*LockResponse) GetKey

func (m *LockResponse) GetKey() []byte

func (*LockResponse) Marshal

func (m *LockResponse) Marshal() (dAtA []byte, err error)

func (*LockResponse) MarshalTo

func (m *LockResponse) MarshalTo(dAtA []byte) (int, error)

func (*LockResponse) MarshalToSizedBuffer

func (m *LockResponse) MarshalToSizedBuffer(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

func (*LockResponse) XXX_DiscardUnknown

func (m *LockResponse) XXX_DiscardUnknown()

func (*LockResponse) XXX_Marshal

func (m *LockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LockResponse) XXX_Merge

func (m *LockResponse) XXX_Merge(src proto.Message)

func (*LockResponse) XXX_Size

func (m *LockResponse) XXX_Size() int

func (*LockResponse) XXX_Unmarshal

func (m *LockResponse) XXX_Unmarshal(b []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)
}

LockServer is the server API for Lock service.

type UnimplementedLockServer

type UnimplementedLockServer struct {
}

UnimplementedLockServer can be embedded to have forward compatible implementations.

func (*UnimplementedLockServer) Lock

func (*UnimplementedLockServer) Unlock

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UnlockRequest) Descriptor

func (*UnlockRequest) Descriptor() ([]byte, []int)

func (*UnlockRequest) GetKey

func (m *UnlockRequest) GetKey() []byte

func (*UnlockRequest) Marshal

func (m *UnlockRequest) Marshal() (dAtA []byte, err error)

func (*UnlockRequest) MarshalTo

func (m *UnlockRequest) MarshalTo(dAtA []byte) (int, error)

func (*UnlockRequest) MarshalToSizedBuffer

func (m *UnlockRequest) MarshalToSizedBuffer(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

func (*UnlockRequest) XXX_DiscardUnknown

func (m *UnlockRequest) XXX_DiscardUnknown()

func (*UnlockRequest) XXX_Marshal

func (m *UnlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnlockRequest) XXX_Merge

func (m *UnlockRequest) XXX_Merge(src proto.Message)

func (*UnlockRequest) XXX_Size

func (m *UnlockRequest) XXX_Size() int

func (*UnlockRequest) XXX_Unmarshal

func (m *UnlockRequest) XXX_Unmarshal(b []byte) error

type UnlockResponse

type UnlockResponse struct {
	Header               *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

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) MarshalToSizedBuffer

func (m *UnlockResponse) MarshalToSizedBuffer(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

func (*UnlockResponse) XXX_DiscardUnknown

func (m *UnlockResponse) XXX_DiscardUnknown()

func (*UnlockResponse) XXX_Marshal

func (m *UnlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnlockResponse) XXX_Merge

func (m *UnlockResponse) XXX_Merge(src proto.Message)

func (*UnlockResponse) XXX_Size

func (m *UnlockResponse) XXX_Size() int

func (*UnlockResponse) XXX_Unmarshal

func (m *UnlockResponse) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis
Package v3lockpb is a reverse proxy.
Package v3lockpb is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL