/
githubmirror
/
etcd
Обзор
Документация
Войти
/
githubmirror
/
etcd
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
api/mvccpb/kv.pb.go
308 строк
8 KB
Wei Fu
*: re-generate pb file by google.golang.org/protobuf
15 май 2026, 13:36
15 май 2026, 13:36
2df1151
Код
Авторство
О чём код?
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc v3.20.3 // source: kv.proto package mvccpb import ( reflect "reflect" sync "sync" unsafe "unsafe" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Event_EventType int32 const ( Event_PUT Event_EventType = 0 Event_DELETE Event_EventType = 1 ) // Enum value maps for Event_EventType. var ( Event_EventType_name = map[int32]string{ 0: "PUT", 1: "DELETE", } Event_EventType_value = map[string]int32{ "PUT": 0, "DELETE": 1, } ) func (x Event_EventType) Enum() *Event_EventType { p := new(Event_EventType) *p = x return p } func (x Event_EventType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (Event_EventType) Descriptor() protoreflect.EnumDescriptor { return file_kv_proto_enumTypes[0].Descriptor() } func (Event_EventType) Type() protoreflect.EnumType { return &file_kv_proto_enumTypes[0] } func (x Event_EventType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use Event_EventType.Descriptor instead. func (Event_EventType) EnumDescriptor() ([]byte, []int) { return file_kv_proto_rawDescGZIP(), []int{1, 0} } type KeyValue struct { state protoimpl.MessageState `protogen:"open.v1"` // 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"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *KeyValue) Reset() { *x = KeyValue{} mi := &file_kv_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *KeyValue) String() string { return protoimpl.X.MessageStringOf(x) } func (*KeyValue) ProtoMessage() {} func (x *KeyValue) ProtoReflect() protoreflect.Message { mi := &file_kv_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. func (*KeyValue) Descriptor() ([]byte, []int) { return file_kv_proto_rawDescGZIP(), []int{0} } func (x *KeyValue) GetKey() []byte { if x != nil { return x.Key } return nil } func (x *KeyValue) GetCreateRevision() int64 { if x != nil { return x.CreateRevision } return 0 } func (x *KeyValue) GetModRevision() int64 { if x != nil { return x.ModRevision } return 0 } func (x *KeyValue) GetVersion() int64 { if x != nil { return x.Version } return 0 } func (x *KeyValue) GetValue() []byte { if x != nil { return x.Value } return nil } func (x *KeyValue) GetLease() int64 { if x != nil { return x.Lease } return 0 } type Event struct { state protoimpl.MessageState `protogen:"open.v1"` // 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"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Event) Reset() { *x = Event{} mi := &file_kv_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Event) String() string { return protoimpl.X.MessageStringOf(x) } func (*Event) ProtoMessage() {} func (x *Event) ProtoReflect() protoreflect.Message { mi := &file_kv_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Event.ProtoReflect.Descriptor instead. func (*Event) Descriptor() ([]byte, []int) { return file_kv_proto_rawDescGZIP(), []int{1} } func (x *Event) GetType() Event_EventType { if x != nil { return x.Type } return Event_PUT } func (x *Event) GetKv() *KeyValue { if x != nil { return x.Kv } return nil } func (x *Event) GetPrevKv() *KeyValue { if x != nil { return x.PrevKv } return nil } var File_kv_proto protoreflect.FileDescriptor const file_kv_proto_rawDesc = "" + "\n" + "\bkv.proto\x12\x06mvccpb\"\xae\x01\n" + "\bKeyValue\x12\x10\n" + "\x03key\x18\x01 \x01(\fR\x03key\x12'\n" + "\x0fcreate_revision\x18\x02 \x01(\x03R\x0ecreateRevision\x12!\n" + "\fmod_revision\x18\x03 \x01(\x03R\vmodRevision\x12\x18\n" + "\aversion\x18\x04 \x01(\x03R\aversion\x12\x14\n" + "\x05value\x18\x05 \x01(\fR\x05value\x12\x14\n" + "\x05lease\x18\x06 \x01(\x03R\x05lease\"\xa3\x01\n" + "\x05Event\x12+\n" + "\x04type\x18\x01 \x01(\x0e2\x17.mvccpb.Event.EventTypeR\x04type\x12 \n" + "\x02kv\x18\x02 \x01(\v2\x10.mvccpb.KeyValueR\x02kv\x12)\n" + "\aprev_kv\x18\x03 \x01(\v2\x10.mvccpb.KeyValueR\x06prevKv\" \n" + "\tEventType\x12\a\n" + "\x03PUT\x10\x00\x12\n" + "\n" + "\x06DELETE\x10\x01B\x1fZ\x1dgo.etcd.io/etcd/api/v3/mvccpbb\x06proto3" var ( file_kv_proto_rawDescOnce sync.Once file_kv_proto_rawDescData []byte ) func file_kv_proto_rawDescGZIP() []byte { file_kv_proto_rawDescOnce.Do(func() { file_kv_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_kv_proto_rawDesc), len(file_kv_proto_rawDesc))) }) return file_kv_proto_rawDescData } var file_kv_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_kv_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_kv_proto_goTypes = []any{ (Event_EventType)(0), // 0: mvccpb.Event.EventType (*KeyValue)(nil), // 1: mvccpb.KeyValue (*Event)(nil), // 2: mvccpb.Event } var file_kv_proto_depIdxs = []int32{ 0, // 0: mvccpb.Event.type:type_name -> mvccpb.Event.EventType 1, // 1: mvccpb.Event.kv:type_name -> mvccpb.KeyValue 1, // 2: mvccpb.Event.prev_kv:type_name -> mvccpb.KeyValue 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name } func init() { file_kv_proto_init() } func file_kv_proto_init() { if File_kv_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_kv_proto_rawDesc), len(file_kv_proto_rawDesc)), NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, GoTypes: file_kv_proto_goTypes, DependencyIndexes: file_kv_proto_depIdxs, EnumInfos: file_kv_proto_enumTypes, MessageInfos: file_kv_proto_msgTypes, }.Build() File_kv_proto = out.File file_kv_proto_goTypes = nil file_kv_proto_depIdxs = nil }