Documentation
¶
Index ¶
- Constants
- Variables
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetKv() *KeyValue
- func (x *Event) GetPrevKv() *KeyValue
- func (x *Event) GetType() Event_EventType
- func (e *Event) IsCreate() bool
- func (e *Event) IsModify() bool
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type Event_EventType
- func (Event_EventType) Descriptor() protoreflect.EnumDescriptor
- func (x Event_EventType) Enum() *Event_EventType
- func (Event_EventType) EnumDescriptor() ([]byte, []int)deprecated
- func (x Event_EventType) Number() protoreflect.EnumNumber
- func (x Event_EventType) String() string
- func (Event_EventType) Type() protoreflect.EnumType
- type KeyValue
- func (*KeyValue) Descriptor() ([]byte, []int)deprecated
- func (x *KeyValue) GetCreateRevision() int64
- func (x *KeyValue) GetKey() []byte
- func (x *KeyValue) GetLease() int64
- func (x *KeyValue) GetModRevision() int64
- func (x *KeyValue) GetValue() []byte
- func (x *KeyValue) GetVersion() int64
- func (*KeyValue) ProtoMessage()
- func (x *KeyValue) ProtoReflect() protoreflect.Message
- func (x *KeyValue) Reset()
- func (x *KeyValue) String() string
Constants ¶
View Source
const ( // PUT is an alias of Event_PUT // Deprecated: use Event_PUT instead. Will be removed in v3.8. PUT = Event_PUT // DELETE is an alias of Permission_WRITE // Deprecated: use Event_DELETE instead. Will be removed in v3.8. DELETE = Event_DELETE )
Variables ¶
View Source
var ( Event_EventType_name = map[int32]string{ 0: "PUT", 1: "DELETE", } Event_EventType_value = map[string]int32{ "PUT": 0, "DELETE": 1, } )
Enum value maps for Event_EventType.
View Source
var File_kv_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// type is the kind of event. If type is a PUT, it indicates
// new data has been stored to the key. If type is a DELETE,
// it indicates the key was deleted.
Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=mvccpb.Event_EventType" json:"type,omitempty"`
// kv holds the KeyValue for the event.
// A PUT event contains current kv pair.
// A PUT event with kv.Version=1 indicates the creation of a key.
// A DELETE/EXPIRE event contains the deleted key with
// its modification revision set to the revision of deletion.
Kv *KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"`
// prev_kv holds the key-value pair before the event happens.
PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"`
// contains filtered or unexported fields
}
func (*Event) Descriptor
deprecated
func (*Event) GetType ¶ added in v3.7.0
func (x *Event) GetType() Event_EventType
func (*Event) IsCreate ¶ added in v3.7.0
IsCreate returns true if the event tells that the key is newly created.
func (*Event) IsModify ¶ added in v3.7.0
IsModify returns true if the event tells that a new value is put on existing key.
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶ added in v3.7.0
func (x *Event) ProtoReflect() protoreflect.Message
type Event_EventType ¶
type Event_EventType int32
const ( Event_PUT Event_EventType = 0 Event_DELETE Event_EventType = 1 )
func (Event_EventType) Descriptor ¶ added in v3.7.0
func (Event_EventType) Descriptor() protoreflect.EnumDescriptor
func (Event_EventType) Enum ¶ added in v3.7.0
func (x Event_EventType) Enum() *Event_EventType
func (Event_EventType) EnumDescriptor
deprecated
func (Event_EventType) EnumDescriptor() ([]byte, []int)
Deprecated: Use Event_EventType.Descriptor instead.
func (Event_EventType) Number ¶ added in v3.7.0
func (x Event_EventType) Number() protoreflect.EnumNumber
func (Event_EventType) String ¶
func (x Event_EventType) String() string
func (Event_EventType) Type ¶ added in v3.7.0
func (Event_EventType) Type() protoreflect.EnumType
type KeyValue ¶
type KeyValue struct {
// key is the key in bytes. An empty key is not allowed.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// create_revision is the revision of last creation on this key.
CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"`
// mod_revision is the revision of last modification on this key.
ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"`
// version is the version of the key. A deletion resets
// the version to zero and any modification of the key
// increases its version.
Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
// value is the value held by the key, in bytes.
Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
// lease is the ID of the lease that attached to key.
// When the attached lease expires, the key will be deleted.
// If lease is 0, then no lease is attached to the key.
Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"`
// contains filtered or unexported fields
}
func (*KeyValue) Descriptor
deprecated
func (*KeyValue) GetCreateRevision ¶ added in v3.7.0
func (*KeyValue) GetModRevision ¶ added in v3.7.0
func (*KeyValue) GetVersion ¶ added in v3.7.0
func (*KeyValue) ProtoMessage ¶
func (*KeyValue) ProtoMessage()
func (*KeyValue) ProtoReflect ¶ added in v3.7.0
func (x *KeyValue) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.