From 7b379bf1f16e5ead266fcbc4baabd2ed03472860 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 3 Jun 2020 09:45:08 +0100 Subject: [PATCH] WIP: Add metadata to store record (#1604) * Add metadata to store record * Add metadata to cockroach store * add metadata to store service implementation * fix breaking cache test * Test/fix cockroach metadata usage * fix store memory metadata bug --- store/cache/cache_test.go | 15 +- store/cockroach/cockroach.go | 50 +- store/cockroach/metadata.go | 45 + store/file/file.go | 17 + store/memory/memory.go | 36 +- store/service/proto/store.pb.go | 2097 ++++++++++++++----------- store/service/proto/store.pb.micro.go | 2 +- store/service/proto/store.proto | 9 + store/service/service.go | 35 +- store/store.go | 9 +- 10 files changed, 1378 insertions(+), 937 deletions(-) create mode 100644 store/cockroach/metadata.go diff --git a/store/cache/cache_test.go b/store/cache/cache_test.go index ddfa5494..132e9acf 100644 --- a/store/cache/cache_test.go +++ b/store/cache/cache_test.go @@ -28,16 +28,19 @@ func TestCache(t *testing.T) { _, err := cachedStore.Read("test") assert.Equal(store.ErrNotFound, err, "Read non existant key") r1 := &store.Record{ - Key: "aaa", - Value: []byte("bbb"), + Key: "aaa", + Value: []byte("bbb"), + Metadata: map[string]interface{}{}, } r2 := &store.Record{ - Key: "aaaa", - Value: []byte("bbbb"), + Key: "aaaa", + Value: []byte("bbbb"), + Metadata: map[string]interface{}{}, } r3 := &store.Record{ - Key: "aaaaa", - Value: []byte("bbbbb"), + Key: "aaaaa", + Value: []byte("bbbbb"), + Metadata: map[string]interface{}{}, } // Write 3 records directly to l2 l2.Write(r1) diff --git a/store/cockroach/cockroach.go b/store/cockroach/cockroach.go index bd6ae34f..55b14a9b 100644 --- a/store/cockroach/cockroach.go +++ b/store/cockroach/cockroach.go @@ -27,11 +27,11 @@ var ( re = regexp.MustCompile("[^a-zA-Z0-9]+") statements = map[string]string{ - "list": "SELECT key, value, expiry FROM %s.%s;", - "read": "SELECT key, value, expiry FROM %s.%s WHERE key = $1;", - "readMany": "SELECT key, value, expiry FROM %s.%s WHERE key LIKE $1;", - "readOffset": "SELECT key, value, expiry FROM %s.%s WHERE key LIKE $1 ORDER BY key DESC LIMIT $2 OFFSET $3;", - "write": "INSERT INTO %s.%s(key, value, expiry) VALUES ($1, $2::bytea, $3) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, expiry = EXCLUDED.expiry;", + "list": "SELECT key, value, metadata, expiry FROM %s.%s;", + "read": "SELECT key, value, metadata, expiry FROM %s.%s WHERE key = $1;", + "readMany": "SELECT key, value, metadata, expiry FROM %s.%s WHERE key LIKE $1;", + "readOffset": "SELECT key, value, metadata, expiry FROM %s.%s WHERE key LIKE $1 ORDER BY key DESC LIMIT $2 OFFSET $3;", + "write": "INSERT INTO %s.%s(key, value, metadata, expiry) VALUES ($1, $2::bytea, $3, $4) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, metadata = EXCLUDED.metadata, expiry = EXCLUDED.expiry;", "delete": "DELETE FROM %s.%s WHERE key = $1;", } ) @@ -108,6 +108,7 @@ func (s *sqlStore) initDB(database, table string) error { ( key text NOT NULL, value bytea, + metadata JSONB, expiry timestamp with time zone, CONSTRAINT %s_pkey PRIMARY KEY (key) );`, table, table)) @@ -121,6 +122,12 @@ func (s *sqlStore) initDB(database, table string) error { return err } + // Create Metadata Index + _, err = s.db.Exec(fmt.Sprintf(`CREATE INDEX IF NOT EXISTS "%s" ON %s.%s USING GIN ("metadata");`, "metadata_index_"+table, database, table)) + if err != nil { + return err + } + return nil } @@ -227,9 +234,15 @@ func (s *sqlStore) List(opts ...store.ListOption) ([]string, error) { for rows.Next() { record := &store.Record{} - if err := rows.Scan(&record.Key, &record.Value, &timehelper); err != nil { + metadata := make(Metadata) + + if err := rows.Scan(&record.Key, &record.Value, &metadata, &timehelper); err != nil { return keys, err } + + // set the metadata + record.Metadata = toMetadata(&metadata) + if timehelper.Valid { if timehelper.Time.Before(time.Now()) { // record has expired @@ -281,12 +294,18 @@ func (s *sqlStore) Read(key string, opts ...store.ReadOption) ([]*store.Record, row := st.QueryRow(key) record := &store.Record{} - if err := row.Scan(&record.Key, &record.Value, &timehelper); err != nil { + metadata := make(Metadata) + + if err := row.Scan(&record.Key, &record.Value, &metadata, &timehelper); err != nil { if err == sql.ErrNoRows { return records, store.ErrNotFound } return records, err } + + // set the metadata + record.Metadata = toMetadata(&metadata) + if timehelper.Valid { if timehelper.Time.Before(time.Now()) { // record has expired @@ -346,9 +365,15 @@ func (s *sqlStore) read(key string, options store.ReadOptions) ([]*store.Record, for rows.Next() { record := &store.Record{} - if err := rows.Scan(&record.Key, &record.Value, &timehelper); err != nil { + metadata := make(Metadata) + + if err := rows.Scan(&record.Key, &record.Value, &metadata, &timehelper); err != nil { return records, err } + + // set the metadata + record.Metadata = toMetadata(&metadata) + if timehelper.Valid { if timehelper.Time.Before(time.Now()) { // record has expired @@ -391,10 +416,15 @@ func (s *sqlStore) Write(r *store.Record, opts ...store.WriteOption) error { } defer st.Close() + metadata := make(Metadata) + for k, v := range r.Metadata { + metadata[k] = v + } + if r.Expiry != 0 { - _, err = st.Exec(r.Key, r.Value, time.Now().Add(r.Expiry)) + _, err = st.Exec(r.Key, r.Value, metadata, time.Now().Add(r.Expiry)) } else { - _, err = st.Exec(r.Key, r.Value, nil) + _, err = st.Exec(r.Key, r.Value, metadata, nil) } if err != nil { diff --git a/store/cockroach/metadata.go b/store/cockroach/metadata.go new file mode 100644 index 00000000..21bb284e --- /dev/null +++ b/store/cockroach/metadata.go @@ -0,0 +1,45 @@ +package cockroach + +import ( + "database/sql/driver" + "encoding/json" + "errors" +) + +// https://github.com/upper/db/blob/master/postgresql/custom_types.go#L43 +type Metadata map[string]interface{} + +// Scan satisfies the sql.Scanner interface. +func (m *Metadata) Scan(src interface{}) error { + source, ok := src.([]byte) + if !ok { + return errors.New("Type assertion .([]byte) failed.") + } + + var i interface{} + err := json.Unmarshal(source, &i) + if err != nil { + return err + } + + *m, ok = i.(map[string]interface{}) + if !ok { + return errors.New("Type assertion .(map[string]interface{}) failed.") + } + + return nil +} + +// Value satisfies the driver.Valuer interface. +func (m Metadata) Value() (driver.Value, error) { + j, err := json.Marshal(m) + return j, err +} + +func toMetadata(m *Metadata) map[string]interface{} { + md := make(map[string]interface{}) + for k, v := range *m { + md[k] = v + } + return md +} diff --git a/store/file/file.go b/store/file/file.go index 5abd6da0..71bd0f83 100644 --- a/store/file/file.go +++ b/store/file/file.go @@ -54,6 +54,7 @@ type fileHandle struct { type record struct { Key string Value []byte + Metadata map[string]interface{} ExpiresAt time.Time } @@ -221,6 +222,11 @@ func (m *fileStore) get(fd *fileHandle, k string) (*store.Record, error) { newRecord := &store.Record{} newRecord.Key = storedRecord.Key newRecord.Value = storedRecord.Value + newRecord.Metadata = make(map[string]interface{}) + + for k, v := range storedRecord.Metadata { + newRecord.Metadata[k] = v + } if !storedRecord.ExpiresAt.IsZero() { if storedRecord.ExpiresAt.Before(time.Now()) { @@ -238,10 +244,16 @@ func (m *fileStore) set(fd *fileHandle, r *store.Record) error { item := &record{} item.Key = r.Key item.Value = r.Value + item.Metadata = make(map[string]interface{}) + if r.Expiry != 0 { item.ExpiresAt = time.Now().Add(r.Expiry) } + for k, v := range r.Metadata { + item.Metadata[k] = v + } + // marshal the data data, _ := json.Marshal(item) @@ -348,6 +360,7 @@ func (m *fileStore) Write(r *store.Record, opts ...store.WriteOption) error { newRecord := store.Record{} newRecord.Key = r.Key newRecord.Value = r.Value + newRecord.Metadata = make(map[string]interface{}) newRecord.Expiry = r.Expiry if !writeOpts.Expiry.IsZero() { @@ -357,6 +370,10 @@ func (m *fileStore) Write(r *store.Record, opts ...store.WriteOption) error { newRecord.Expiry = writeOpts.TTL } + for k, v := range r.Metadata { + newRecord.Metadata[k] = v + } + return m.set(fd, &newRecord) } diff --git a/store/memory/memory.go b/store/memory/memory.go index 33ded427..bb3578c2 100644 --- a/store/memory/memory.go +++ b/store/memory/memory.go @@ -33,9 +33,10 @@ type memoryStore struct { store *cache.Cache } -type internalRecord struct { +type storeRecord struct { key string value []byte + metadata map[string]interface{} expiresAt time.Time } @@ -56,26 +57,36 @@ func (m *memoryStore) prefix(database, table string) string { func (m *memoryStore) get(prefix, key string) (*store.Record, error) { key = m.key(prefix, key) - var storedRecord *internalRecord + var storedRecord *storeRecord r, found := m.store.Get(key) if !found { return nil, store.ErrNotFound } - storedRecord, ok := r.(*internalRecord) + storedRecord, ok := r.(*storeRecord) if !ok { - return nil, errors.New("Retrieved a non *internalRecord from the cache") + return nil, errors.New("Retrieved a non *storeRecord from the cache") } // Copy the record on the way out newRecord := &store.Record{} newRecord.Key = strings.TrimPrefix(storedRecord.key, prefix+"/") newRecord.Value = make([]byte, len(storedRecord.value)) + newRecord.Metadata = make(map[string]interface{}) + + // copy the value into the new record copy(newRecord.Value, storedRecord.value) + + // check if we need to set the expiry if !storedRecord.expiresAt.IsZero() { newRecord.Expiry = time.Until(storedRecord.expiresAt) } + // copy in the metadata + for k, v := range storedRecord.metadata { + newRecord.Metadata[k] = v + } + return newRecord, nil } @@ -84,15 +95,24 @@ func (m *memoryStore) set(prefix string, r *store.Record) { // copy the incoming record and then // convert the expiry in to a hard timestamp - i := &internalRecord{} + i := &storeRecord{} i.key = r.Key i.value = make([]byte, len(r.Value)) + i.metadata = make(map[string]interface{}) + + // copy the the value copy(i.value, r.Value) + // set the expiry if r.Expiry != 0 { i.expiresAt = time.Now().Add(r.Expiry) } + // set the metadata + for k, v := range r.Metadata { + i.metadata[k] = v + } + m.store.Set(key, i, r.Expiry) } @@ -199,6 +219,7 @@ func (m *memoryStore) Write(r *store.Record, opts ...store.WriteOption) error { newRecord := store.Record{} newRecord.Key = r.Key newRecord.Value = make([]byte, len(r.Value)) + newRecord.Metadata = make(map[string]interface{}) copy(newRecord.Value, r.Value) newRecord.Expiry = r.Expiry @@ -208,6 +229,11 @@ func (m *memoryStore) Write(r *store.Record, opts ...store.WriteOption) error { if writeOpts.TTL != 0 { newRecord.Expiry = writeOpts.TTL } + + for k, v := range r.Metadata { + newRecord.Metadata[k] = v + } + m.set(prefix, &newRecord) return nil } diff --git a/store/service/proto/store.pb.go b/store/service/proto/store.pb.go index 60eddeec..f8f82515 100644 --- a/store/service/proto/store.pb.go +++ b/store/service/proto/store.pb.go @@ -1,1172 +1,1455 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: store/service/proto/store.proto +// versions: +// protoc-gen-go v1.22.0 +// protoc v3.11.4 +// source: github.com/micro/go-micro/store/service/proto/store.proto package go_micro_store import ( - context "context" - fmt "fmt" proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Field struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // type of value e.g string, int, int64, bool, float64 + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // the actual value + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Field) Reset() { + *x = Field{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Field) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Field) ProtoMessage() {} + +func (x *Field) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Field.ProtoReflect.Descriptor instead. +func (*Field) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{0} +} + +func (x *Field) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Field) GetValue() string { + if x != nil { + return x.Value + } + return "" +} type Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // key of the record Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // value in the record Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // time.Duration (signed int64 nanoseconds) - Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` + // the associated metadata + Metadata map[string]*Field `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *Record) Reset() { *m = Record{} } -func (m *Record) String() string { return proto.CompactTextString(m) } -func (*Record) ProtoMessage() {} +func (x *Record) Reset() { + *x = Record{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Record) ProtoMessage() {} + +func (x *Record) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Record.ProtoReflect.Descriptor instead. func (*Record) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{0} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{1} } -func (m *Record) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Record.Unmarshal(m, b) -} -func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Record.Marshal(b, m, deterministic) -} -func (m *Record) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record.Merge(m, src) -} -func (m *Record) XXX_Size() int { - return xxx_messageInfo_Record.Size(m) -} -func (m *Record) XXX_DiscardUnknown() { - xxx_messageInfo_Record.DiscardUnknown(m) -} - -var xxx_messageInfo_Record proto.InternalMessageInfo - -func (m *Record) GetKey() string { - if m != nil { - return m.Key +func (x *Record) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *Record) GetValue() []byte { - if m != nil { - return m.Value +func (x *Record) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *Record) GetExpiry() int64 { - if m != nil { - return m.Expiry +func (x *Record) GetExpiry() int64 { + if x != nil { + return x.Expiry } return 0 } +func (x *Record) GetMetadata() map[string]*Field { + if x != nil { + return x.Metadata + } + return nil +} + type ReadOptions struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - Prefix bool `protobuf:"varint,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Suffix bool `protobuf:"varint,4,opt,name=suffix,proto3" json:"suffix,omitempty"` - Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` + Prefix bool `protobuf:"varint,3,opt,name=prefix,proto3" json:"prefix,omitempty"` + Suffix bool `protobuf:"varint,4,opt,name=suffix,proto3" json:"suffix,omitempty"` + Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` } -func (m *ReadOptions) Reset() { *m = ReadOptions{} } -func (m *ReadOptions) String() string { return proto.CompactTextString(m) } -func (*ReadOptions) ProtoMessage() {} +func (x *ReadOptions) Reset() { + *x = ReadOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadOptions) ProtoMessage() {} + +func (x *ReadOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadOptions.ProtoReflect.Descriptor instead. func (*ReadOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{1} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{2} } -func (m *ReadOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadOptions.Unmarshal(m, b) -} -func (m *ReadOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadOptions.Marshal(b, m, deterministic) -} -func (m *ReadOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadOptions.Merge(m, src) -} -func (m *ReadOptions) XXX_Size() int { - return xxx_messageInfo_ReadOptions.Size(m) -} -func (m *ReadOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ReadOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadOptions proto.InternalMessageInfo - -func (m *ReadOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *ReadOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *ReadOptions) GetTable() string { - if m != nil { - return m.Table +func (x *ReadOptions) GetTable() string { + if x != nil { + return x.Table } return "" } -func (m *ReadOptions) GetPrefix() bool { - if m != nil { - return m.Prefix +func (x *ReadOptions) GetPrefix() bool { + if x != nil { + return x.Prefix } return false } -func (m *ReadOptions) GetSuffix() bool { - if m != nil { - return m.Suffix +func (x *ReadOptions) GetSuffix() bool { + if x != nil { + return x.Suffix } return false } -func (m *ReadOptions) GetLimit() uint64 { - if m != nil { - return m.Limit +func (x *ReadOptions) GetLimit() uint64 { + if x != nil { + return x.Limit } return 0 } -func (m *ReadOptions) GetOffset() uint64 { - if m != nil { - return m.Offset +func (x *ReadOptions) GetOffset() uint64 { + if x != nil { + return x.Offset } return 0 } type ReadRequest struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Options *ReadOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Options *ReadOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` } -func (m *ReadRequest) Reset() { *m = ReadRequest{} } -func (m *ReadRequest) String() string { return proto.CompactTextString(m) } -func (*ReadRequest) ProtoMessage() {} +func (x *ReadRequest) Reset() { + *x = ReadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadRequest) ProtoMessage() {} + +func (x *ReadRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead. func (*ReadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{2} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{3} } -func (m *ReadRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadRequest.Unmarshal(m, b) -} -func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) -} -func (m *ReadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadRequest.Merge(m, src) -} -func (m *ReadRequest) XXX_Size() int { - return xxx_messageInfo_ReadRequest.Size(m) -} -func (m *ReadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadRequest proto.InternalMessageInfo - -func (m *ReadRequest) GetKey() string { - if m != nil { - return m.Key +func (x *ReadRequest) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *ReadRequest) GetOptions() *ReadOptions { - if m != nil { - return m.Options +func (x *ReadRequest) GetOptions() *ReadOptions { + if x != nil { + return x.Options } return nil } type ReadResponse struct { - Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` } -func (m *ReadResponse) Reset() { *m = ReadResponse{} } -func (m *ReadResponse) String() string { return proto.CompactTextString(m) } -func (*ReadResponse) ProtoMessage() {} +func (x *ReadResponse) Reset() { + *x = ReadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResponse) ProtoMessage() {} + +func (x *ReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead. func (*ReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{3} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{4} } -func (m *ReadResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadResponse.Unmarshal(m, b) -} -func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic) -} -func (m *ReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadResponse.Merge(m, src) -} -func (m *ReadResponse) XXX_Size() int { - return xxx_messageInfo_ReadResponse.Size(m) -} -func (m *ReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReadResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadResponse proto.InternalMessageInfo - -func (m *ReadResponse) GetRecords() []*Record { - if m != nil { - return m.Records +func (x *ReadResponse) GetRecords() []*Record { + if x != nil { + return x.Records } return nil } type WriteOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` // time.Time Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` // time.Duration - Ttl int64 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Ttl int64 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"` } -func (m *WriteOptions) Reset() { *m = WriteOptions{} } -func (m *WriteOptions) String() string { return proto.CompactTextString(m) } -func (*WriteOptions) ProtoMessage() {} +func (x *WriteOptions) Reset() { + *x = WriteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteOptions) ProtoMessage() {} + +func (x *WriteOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteOptions.ProtoReflect.Descriptor instead. func (*WriteOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{4} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{5} } -func (m *WriteOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteOptions.Unmarshal(m, b) -} -func (m *WriteOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteOptions.Marshal(b, m, deterministic) -} -func (m *WriteOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteOptions.Merge(m, src) -} -func (m *WriteOptions) XXX_Size() int { - return xxx_messageInfo_WriteOptions.Size(m) -} -func (m *WriteOptions) XXX_DiscardUnknown() { - xxx_messageInfo_WriteOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteOptions proto.InternalMessageInfo - -func (m *WriteOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *WriteOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *WriteOptions) GetTable() string { - if m != nil { - return m.Table +func (x *WriteOptions) GetTable() string { + if x != nil { + return x.Table } return "" } -func (m *WriteOptions) GetExpiry() int64 { - if m != nil { - return m.Expiry +func (x *WriteOptions) GetExpiry() int64 { + if x != nil { + return x.Expiry } return 0 } -func (m *WriteOptions) GetTtl() int64 { - if m != nil { - return m.Ttl +func (x *WriteOptions) GetTtl() int64 { + if x != nil { + return x.Ttl } return 0 } type WriteRequest struct { - Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` - Options *WriteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` + Options *WriteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` } -func (m *WriteRequest) Reset() { *m = WriteRequest{} } -func (m *WriteRequest) String() string { return proto.CompactTextString(m) } -func (*WriteRequest) ProtoMessage() {} +func (x *WriteRequest) Reset() { + *x = WriteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteRequest) ProtoMessage() {} + +func (x *WriteRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead. func (*WriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{5} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{6} } -func (m *WriteRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteRequest.Unmarshal(m, b) -} -func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) -} -func (m *WriteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteRequest.Merge(m, src) -} -func (m *WriteRequest) XXX_Size() int { - return xxx_messageInfo_WriteRequest.Size(m) -} -func (m *WriteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteRequest proto.InternalMessageInfo - -func (m *WriteRequest) GetRecord() *Record { - if m != nil { - return m.Record +func (x *WriteRequest) GetRecord() *Record { + if x != nil { + return x.Record } return nil } -func (m *WriteRequest) GetOptions() *WriteOptions { - if m != nil { - return m.Options +func (x *WriteRequest) GetOptions() *WriteOptions { + if x != nil { + return x.Options } return nil } type WriteResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *WriteResponse) Reset() { *m = WriteResponse{} } -func (m *WriteResponse) String() string { return proto.CompactTextString(m) } -func (*WriteResponse) ProtoMessage() {} +func (x *WriteResponse) Reset() { + *x = WriteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteResponse) ProtoMessage() {} + +func (x *WriteResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead. func (*WriteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{6} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{7} } -func (m *WriteResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteResponse.Unmarshal(m, b) -} -func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic) -} -func (m *WriteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteResponse.Merge(m, src) -} -func (m *WriteResponse) XXX_Size() int { - return xxx_messageInfo_WriteResponse.Size(m) -} -func (m *WriteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WriteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteResponse proto.InternalMessageInfo - type DeleteOptions struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` } -func (m *DeleteOptions) Reset() { *m = DeleteOptions{} } -func (m *DeleteOptions) String() string { return proto.CompactTextString(m) } -func (*DeleteOptions) ProtoMessage() {} +func (x *DeleteOptions) Reset() { + *x = DeleteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteOptions) ProtoMessage() {} + +func (x *DeleteOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteOptions.ProtoReflect.Descriptor instead. func (*DeleteOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{7} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{8} } -func (m *DeleteOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteOptions.Unmarshal(m, b) -} -func (m *DeleteOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteOptions.Marshal(b, m, deterministic) -} -func (m *DeleteOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteOptions.Merge(m, src) -} -func (m *DeleteOptions) XXX_Size() int { - return xxx_messageInfo_DeleteOptions.Size(m) -} -func (m *DeleteOptions) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteOptions proto.InternalMessageInfo - -func (m *DeleteOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *DeleteOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *DeleteOptions) GetTable() string { - if m != nil { - return m.Table +func (x *DeleteOptions) GetTable() string { + if x != nil { + return x.Table } return "" } type DeleteRequest struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Options *DeleteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Options *DeleteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` } -func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } -func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRequest) ProtoMessage() {} +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{8} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{9} } -func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRequest.Unmarshal(m, b) -} -func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) -} -func (m *DeleteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRequest.Merge(m, src) -} -func (m *DeleteRequest) XXX_Size() int { - return xxx_messageInfo_DeleteRequest.Size(m) -} -func (m *DeleteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo - -func (m *DeleteRequest) GetKey() string { - if m != nil { - return m.Key +func (x *DeleteRequest) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *DeleteRequest) GetOptions() *DeleteOptions { - if m != nil { - return m.Options +func (x *DeleteRequest) GetOptions() *DeleteOptions { + if x != nil { + return x.Options } return nil } type DeleteResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } -func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteResponse) ProtoMessage() {} +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{9} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{10} } -func (m *DeleteResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteResponse.Unmarshal(m, b) -} -func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic) -} -func (m *DeleteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteResponse.Merge(m, src) -} -func (m *DeleteResponse) XXX_Size() int { - return xxx_messageInfo_DeleteResponse.Size(m) -} -func (m *DeleteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo - type ListOptions struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` - Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` + Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` + Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` + Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` } -func (m *ListOptions) Reset() { *m = ListOptions{} } -func (m *ListOptions) String() string { return proto.CompactTextString(m) } -func (*ListOptions) ProtoMessage() {} +func (x *ListOptions) Reset() { + *x = ListOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListOptions) ProtoMessage() {} + +func (x *ListOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListOptions.ProtoReflect.Descriptor instead. func (*ListOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{10} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{11} } -func (m *ListOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListOptions.Unmarshal(m, b) -} -func (m *ListOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListOptions.Marshal(b, m, deterministic) -} -func (m *ListOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListOptions.Merge(m, src) -} -func (m *ListOptions) XXX_Size() int { - return xxx_messageInfo_ListOptions.Size(m) -} -func (m *ListOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ListOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_ListOptions proto.InternalMessageInfo - -func (m *ListOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *ListOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *ListOptions) GetTable() string { - if m != nil { - return m.Table +func (x *ListOptions) GetTable() string { + if x != nil { + return x.Table } return "" } -func (m *ListOptions) GetPrefix() string { - if m != nil { - return m.Prefix +func (x *ListOptions) GetPrefix() string { + if x != nil { + return x.Prefix } return "" } -func (m *ListOptions) GetSuffix() string { - if m != nil { - return m.Suffix +func (x *ListOptions) GetSuffix() string { + if x != nil { + return x.Suffix } return "" } -func (m *ListOptions) GetLimit() uint64 { - if m != nil { - return m.Limit +func (x *ListOptions) GetLimit() uint64 { + if x != nil { + return x.Limit } return 0 } -func (m *ListOptions) GetOffset() uint64 { - if m != nil { - return m.Offset +func (x *ListOptions) GetOffset() uint64 { + if x != nil { + return x.Offset } return 0 } type ListRequest struct { - Options *ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Options *ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` } -func (m *ListRequest) Reset() { *m = ListRequest{} } -func (m *ListRequest) String() string { return proto.CompactTextString(m) } -func (*ListRequest) ProtoMessage() {} +func (x *ListRequest) Reset() { + *x = ListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequest) ProtoMessage() {} + +func (x *ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. func (*ListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{11} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{12} } -func (m *ListRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListRequest.Unmarshal(m, b) -} -func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic) -} -func (m *ListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListRequest.Merge(m, src) -} -func (m *ListRequest) XXX_Size() int { - return xxx_messageInfo_ListRequest.Size(m) -} -func (m *ListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListRequest proto.InternalMessageInfo - -func (m *ListRequest) GetOptions() *ListOptions { - if m != nil { - return m.Options +func (x *ListRequest) GetOptions() *ListOptions { + if x != nil { + return x.Options } return nil } type ListResponse struct { - Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` } -func (m *ListResponse) Reset() { *m = ListResponse{} } -func (m *ListResponse) String() string { return proto.CompactTextString(m) } -func (*ListResponse) ProtoMessage() {} +func (x *ListResponse) Reset() { + *x = ListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResponse) ProtoMessage() {} + +func (x *ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. func (*ListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{12} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{13} } -func (m *ListResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListResponse.Unmarshal(m, b) -} -func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic) -} -func (m *ListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListResponse.Merge(m, src) -} -func (m *ListResponse) XXX_Size() int { - return xxx_messageInfo_ListResponse.Size(m) -} -func (m *ListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListResponse proto.InternalMessageInfo - -func (m *ListResponse) GetKeys() []string { - if m != nil { - return m.Keys +func (x *ListResponse) GetKeys() []string { + if x != nil { + return x.Keys } return nil } type DatabasesRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *DatabasesRequest) Reset() { *m = DatabasesRequest{} } -func (m *DatabasesRequest) String() string { return proto.CompactTextString(m) } -func (*DatabasesRequest) ProtoMessage() {} +func (x *DatabasesRequest) Reset() { + *x = DatabasesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DatabasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DatabasesRequest) ProtoMessage() {} + +func (x *DatabasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DatabasesRequest.ProtoReflect.Descriptor instead. func (*DatabasesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{13} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{14} } -func (m *DatabasesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DatabasesRequest.Unmarshal(m, b) -} -func (m *DatabasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DatabasesRequest.Marshal(b, m, deterministic) -} -func (m *DatabasesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DatabasesRequest.Merge(m, src) -} -func (m *DatabasesRequest) XXX_Size() int { - return xxx_messageInfo_DatabasesRequest.Size(m) -} -func (m *DatabasesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DatabasesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DatabasesRequest proto.InternalMessageInfo - type DatabasesResponse struct { - Databases []string `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Databases []string `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"` } -func (m *DatabasesResponse) Reset() { *m = DatabasesResponse{} } -func (m *DatabasesResponse) String() string { return proto.CompactTextString(m) } -func (*DatabasesResponse) ProtoMessage() {} +func (x *DatabasesResponse) Reset() { + *x = DatabasesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DatabasesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DatabasesResponse) ProtoMessage() {} + +func (x *DatabasesResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DatabasesResponse.ProtoReflect.Descriptor instead. func (*DatabasesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{14} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{15} } -func (m *DatabasesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DatabasesResponse.Unmarshal(m, b) -} -func (m *DatabasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DatabasesResponse.Marshal(b, m, deterministic) -} -func (m *DatabasesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DatabasesResponse.Merge(m, src) -} -func (m *DatabasesResponse) XXX_Size() int { - return xxx_messageInfo_DatabasesResponse.Size(m) -} -func (m *DatabasesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DatabasesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DatabasesResponse proto.InternalMessageInfo - -func (m *DatabasesResponse) GetDatabases() []string { - if m != nil { - return m.Databases +func (x *DatabasesResponse) GetDatabases() []string { + if x != nil { + return x.Databases } return nil } type TablesRequest struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` } -func (m *TablesRequest) Reset() { *m = TablesRequest{} } -func (m *TablesRequest) String() string { return proto.CompactTextString(m) } -func (*TablesRequest) ProtoMessage() {} +func (x *TablesRequest) Reset() { + *x = TablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TablesRequest) ProtoMessage() {} + +func (x *TablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TablesRequest.ProtoReflect.Descriptor instead. func (*TablesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{15} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{16} } -func (m *TablesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TablesRequest.Unmarshal(m, b) -} -func (m *TablesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TablesRequest.Marshal(b, m, deterministic) -} -func (m *TablesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TablesRequest.Merge(m, src) -} -func (m *TablesRequest) XXX_Size() int { - return xxx_messageInfo_TablesRequest.Size(m) -} -func (m *TablesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TablesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TablesRequest proto.InternalMessageInfo - -func (m *TablesRequest) GetDatabase() string { - if m != nil { - return m.Database +func (x *TablesRequest) GetDatabase() string { + if x != nil { + return x.Database } return "" } type TablesResponse struct { - Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` } -func (m *TablesResponse) Reset() { *m = TablesResponse{} } -func (m *TablesResponse) String() string { return proto.CompactTextString(m) } -func (*TablesResponse) ProtoMessage() {} +func (x *TablesResponse) Reset() { + *x = TablesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TablesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TablesResponse) ProtoMessage() {} + +func (x *TablesResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TablesResponse.ProtoReflect.Descriptor instead. func (*TablesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1ba364858f5c3cdb, []int{16} + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{17} } -func (m *TablesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TablesResponse.Unmarshal(m, b) -} -func (m *TablesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TablesResponse.Marshal(b, m, deterministic) -} -func (m *TablesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TablesResponse.Merge(m, src) -} -func (m *TablesResponse) XXX_Size() int { - return xxx_messageInfo_TablesResponse.Size(m) -} -func (m *TablesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TablesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TablesResponse proto.InternalMessageInfo - -func (m *TablesResponse) GetTables() []string { - if m != nil { - return m.Tables +func (x *TablesResponse) GetTables() []string { + if x != nil { + return x.Tables } return nil } -func init() { - proto.RegisterType((*Record)(nil), "go.micro.store.Record") - proto.RegisterType((*ReadOptions)(nil), "go.micro.store.ReadOptions") - proto.RegisterType((*ReadRequest)(nil), "go.micro.store.ReadRequest") - proto.RegisterType((*ReadResponse)(nil), "go.micro.store.ReadResponse") - proto.RegisterType((*WriteOptions)(nil), "go.micro.store.WriteOptions") - proto.RegisterType((*WriteRequest)(nil), "go.micro.store.WriteRequest") - proto.RegisterType((*WriteResponse)(nil), "go.micro.store.WriteResponse") - proto.RegisterType((*DeleteOptions)(nil), "go.micro.store.DeleteOptions") - proto.RegisterType((*DeleteRequest)(nil), "go.micro.store.DeleteRequest") - proto.RegisterType((*DeleteResponse)(nil), "go.micro.store.DeleteResponse") - proto.RegisterType((*ListOptions)(nil), "go.micro.store.ListOptions") - proto.RegisterType((*ListRequest)(nil), "go.micro.store.ListRequest") - proto.RegisterType((*ListResponse)(nil), "go.micro.store.ListResponse") - proto.RegisterType((*DatabasesRequest)(nil), "go.micro.store.DatabasesRequest") - proto.RegisterType((*DatabasesResponse)(nil), "go.micro.store.DatabasesResponse") - proto.RegisterType((*TablesRequest)(nil), "go.micro.store.TablesRequest") - proto.RegisterType((*TablesResponse)(nil), "go.micro.store.TablesResponse") +var File_github_com_micro_go_micro_store_service_proto_store_proto protoreflect.FileDescriptor + +var file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc = []byte{ + 0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, + 0x72, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, 0x6f, 0x2e, + 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x31, 0x0a, 0x05, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xde, + 0x01, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x52, 0x0a, 0x0d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x9d, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, + 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, + 0x78, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, + 0x56, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x35, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x40, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, + 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x6a, 0x0a, 0x0c, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x74, 0x74, 0x6c, 0x22, 0x76, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, + 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, + 0x0d, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, + 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x22, 0x5a, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x10, 0x0a, + 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x9d, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, + 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, + 0x78, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, + 0x44, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, + 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x28, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, + 0x12, 0x0a, 0x10, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x31, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x22, 0x2b, 0x0a, 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x32, 0xc5, 0x03, + 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, + 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, + 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x05, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x45, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, + 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x06, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func init() { proto.RegisterFile("store/service/proto/store.proto", fileDescriptor_1ba364858f5c3cdb) } +var ( + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescOnce sync.Once + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData = file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc +) -var fileDescriptor_1ba364858f5c3cdb = []byte{ - // 583 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x8e, 0xd2, 0x40, - 0x14, 0xa6, 0xdb, 0xd2, 0xa5, 0x87, 0x1f, 0x71, 0x62, 0x48, 0x83, 0xac, 0xd6, 0xb9, 0x6a, 0x62, - 0x52, 0x56, 0x8c, 0x7a, 0xab, 0x11, 0x8d, 0x1a, 0x13, 0x93, 0xd1, 0x68, 0xe2, 0x5d, 0x81, 0xc1, - 0xd4, 0x65, 0x77, 0xb0, 0x33, 0x90, 0xe5, 0x61, 0x7c, 0x1c, 0xdf, 0xcb, 0xcc, 0x1f, 0x14, 0x68, - 0xf7, 0xc2, 0xf5, 0x6e, 0xce, 0x99, 0xe1, 0x3b, 0xe7, 0xfb, 0x69, 0x80, 0x87, 0x5c, 0xb0, 0x9c, - 0x0e, 0x39, 0xcd, 0xd7, 0xd9, 0x94, 0x0e, 0x97, 0x39, 0x13, 0x6c, 0xa8, 0x7a, 0x89, 0x3a, 0xa3, - 0xce, 0x0f, 0x96, 0x5c, 0x66, 0xd3, 0x9c, 0x25, 0xaa, 0x8b, 0xdf, 0x81, 0x4f, 0xe8, 0x94, 0xe5, - 0x33, 0xd4, 0x05, 0xf7, 0x82, 0x6e, 0x42, 0x27, 0x72, 0xe2, 0x80, 0xc8, 0x23, 0xba, 0x07, 0xf5, - 0x75, 0xba, 0x58, 0xd1, 0xf0, 0x24, 0x72, 0xe2, 0x16, 0xd1, 0x05, 0xea, 0x81, 0x4f, 0xaf, 0x97, - 0x59, 0xbe, 0x09, 0xdd, 0xc8, 0x89, 0x5d, 0x62, 0x2a, 0xfc, 0xdb, 0x81, 0x26, 0xa1, 0xe9, 0xec, - 0xd3, 0x52, 0x64, 0xec, 0x8a, 0xa3, 0x3e, 0x34, 0x66, 0xa9, 0x48, 0x27, 0x29, 0xa7, 0x06, 0x74, - 0x5b, 0x4b, 0x64, 0x91, 0x4e, 0x16, 0x1a, 0x39, 0x20, 0xba, 0x90, 0xc8, 0xcb, 0x9c, 0xce, 0xb3, - 0x6b, 0x85, 0xdc, 0x20, 0xa6, 0x92, 0x7d, 0xbe, 0x9a, 0xcb, 0xbe, 0xa7, 0xfb, 0xba, 0x92, 0x28, - 0x8b, 0xec, 0x32, 0x13, 0x61, 0x3d, 0x72, 0x62, 0x8f, 0xe8, 0x42, 0xbe, 0x66, 0xf3, 0x39, 0xa7, - 0x22, 0xf4, 0x55, 0xdb, 0x54, 0xf8, 0xab, 0x5e, 0x8f, 0xd0, 0x5f, 0x2b, 0xca, 0x45, 0x09, 0xdd, - 0x67, 0x70, 0xca, 0xf4, 0xee, 0x6a, 0xad, 0xe6, 0xe8, 0x7e, 0xb2, 0x2f, 0x56, 0x52, 0xa0, 0x47, - 0xec, 0x5b, 0xfc, 0x12, 0x5a, 0x1a, 0x97, 0x2f, 0xd9, 0x15, 0xa7, 0xe8, 0x1c, 0x4e, 0x73, 0xa5, - 0x28, 0x0f, 0x9d, 0xc8, 0x8d, 0x9b, 0xa3, 0xde, 0x31, 0x8c, 0xbc, 0x26, 0xf6, 0x19, 0xfe, 0x09, - 0xad, 0x6f, 0x79, 0x26, 0xe8, 0xad, 0x94, 0x2b, 0xf3, 0x44, 0x92, 0x14, 0x62, 0xa1, 0x64, 0x73, - 0x89, 0x3c, 0xe2, 0xb5, 0x99, 0x65, 0x65, 0x48, 0xc0, 0xd7, 0x6b, 0xa8, 0x49, 0xd5, 0xcb, 0x9a, - 0x57, 0xe8, 0xf9, 0xa1, 0x48, 0x83, 0xc3, 0x1f, 0x14, 0xa9, 0xec, 0x54, 0xba, 0x03, 0x6d, 0x33, - 0x57, 0xcb, 0x84, 0x5f, 0x41, 0x7b, 0x4c, 0x17, 0xf4, 0x16, 0xac, 0xf1, 0x77, 0x0b, 0x51, 0xed, - 0xe9, 0x8b, 0xc3, 0x75, 0xcf, 0x0e, 0xd7, 0xdd, 0x5b, 0x62, 0xb7, 0x6f, 0x17, 0x3a, 0x16, 0xdb, - 0x2c, 0x2c, 0xf3, 0xfd, 0x31, 0xe3, 0xe2, 0x7f, 0xe5, 0x3b, 0xa8, 0xc8, 0x77, 0xf0, 0x8f, 0xf9, - 0x1e, 0xeb, 0xf5, 0xac, 0x16, 0x85, 0x34, 0x3b, 0xe5, 0x69, 0x2e, 0x90, 0xd9, 0xf1, 0x8e, 0xa1, - 0xa5, 0x51, 0x4c, 0x9a, 0x11, 0x78, 0x17, 0x74, 0x23, 0xd5, 0x73, 0xe3, 0x80, 0xa8, 0xf3, 0x07, - 0xaf, 0xe1, 0x74, 0x4f, 0x30, 0x82, 0xee, 0xd8, 0xf0, 0xe5, 0x66, 0x28, 0x7e, 0x02, 0x77, 0x0b, - 0x3d, 0x03, 0x31, 0x80, 0xc0, 0x0a, 0xa3, 0x3f, 0x89, 0x80, 0xec, 0x1a, 0xf8, 0x31, 0xb4, 0xbf, - 0x48, 0x75, 0x2c, 0xc6, 0x4d, 0xba, 0xe2, 0x18, 0x3a, 0xf6, 0xb1, 0x01, 0xef, 0x81, 0xaf, 0xc4, - 0xb5, 0xc8, 0xa6, 0x1a, 0xfd, 0x71, 0xa1, 0xfe, 0x59, 0xd2, 0x44, 0xaf, 0xc1, 0x93, 0xdf, 0x27, - 0x2a, 0xfd, 0x9a, 0xcd, 0xd0, 0xfe, 0xa0, 0xfc, 0xd2, 0x58, 0x5f, 0x43, 0x6f, 0xa1, 0xae, 0xe2, - 0x8b, 0xca, 0xe3, 0x6e, 0x61, 0xce, 0x2a, 0x6e, 0xb7, 0x38, 0xef, 0xc1, 0xd7, 0xb1, 0x42, 0x15, - 0x41, 0xb4, 0x48, 0x0f, 0xaa, 0xae, 0xb7, 0x50, 0x6f, 0xc0, 0x93, 0x4e, 0xa1, 0x52, 0x5f, 0x2b, - 0x79, 0x15, 0xcd, 0xc5, 0xb5, 0x73, 0x07, 0x11, 0x08, 0xb6, 0x96, 0xa1, 0xe8, 0x68, 0xea, 0x81, - 0xc3, 0xfd, 0x47, 0x37, 0xbc, 0x28, 0xb2, 0xd4, 0x36, 0x1d, 0xb3, 0xdc, 0xf3, 0xfa, 0x98, 0xe5, - 0xbe, 0xbb, 0xb8, 0x36, 0xf1, 0xd5, 0xdf, 0xd6, 0xd3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc9, - 0x9b, 0x47, 0x1c, 0xd9, 0x06, 0x00, 0x00, +func file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP() []byte { + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescOnce.Do(func() { + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData) + }) + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// StoreClient is the client API for Store service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type StoreClient interface { - Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) - Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) - List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (Store_ListClient, error) - Databases(ctx context.Context, in *DatabasesRequest, opts ...grpc.CallOption) (*DatabasesResponse, error) - Tables(ctx context.Context, in *TablesRequest, opts ...grpc.CallOption) (*TablesResponse, error) +var file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_github_com_micro_go_micro_store_service_proto_store_proto_goTypes = []interface{}{ + (*Field)(nil), // 0: go.micro.store.Field + (*Record)(nil), // 1: go.micro.store.Record + (*ReadOptions)(nil), // 2: go.micro.store.ReadOptions + (*ReadRequest)(nil), // 3: go.micro.store.ReadRequest + (*ReadResponse)(nil), // 4: go.micro.store.ReadResponse + (*WriteOptions)(nil), // 5: go.micro.store.WriteOptions + (*WriteRequest)(nil), // 6: go.micro.store.WriteRequest + (*WriteResponse)(nil), // 7: go.micro.store.WriteResponse + (*DeleteOptions)(nil), // 8: go.micro.store.DeleteOptions + (*DeleteRequest)(nil), // 9: go.micro.store.DeleteRequest + (*DeleteResponse)(nil), // 10: go.micro.store.DeleteResponse + (*ListOptions)(nil), // 11: go.micro.store.ListOptions + (*ListRequest)(nil), // 12: go.micro.store.ListRequest + (*ListResponse)(nil), // 13: go.micro.store.ListResponse + (*DatabasesRequest)(nil), // 14: go.micro.store.DatabasesRequest + (*DatabasesResponse)(nil), // 15: go.micro.store.DatabasesResponse + (*TablesRequest)(nil), // 16: go.micro.store.TablesRequest + (*TablesResponse)(nil), // 17: go.micro.store.TablesResponse + nil, // 18: go.micro.store.Record.MetadataEntry +} +var file_github_com_micro_go_micro_store_service_proto_store_proto_depIdxs = []int32{ + 18, // 0: go.micro.store.Record.metadata:type_name -> go.micro.store.Record.MetadataEntry + 2, // 1: go.micro.store.ReadRequest.options:type_name -> go.micro.store.ReadOptions + 1, // 2: go.micro.store.ReadResponse.records:type_name -> go.micro.store.Record + 1, // 3: go.micro.store.WriteRequest.record:type_name -> go.micro.store.Record + 5, // 4: go.micro.store.WriteRequest.options:type_name -> go.micro.store.WriteOptions + 8, // 5: go.micro.store.DeleteRequest.options:type_name -> go.micro.store.DeleteOptions + 11, // 6: go.micro.store.ListRequest.options:type_name -> go.micro.store.ListOptions + 0, // 7: go.micro.store.Record.MetadataEntry.value:type_name -> go.micro.store.Field + 3, // 8: go.micro.store.Store.Read:input_type -> go.micro.store.ReadRequest + 6, // 9: go.micro.store.Store.Write:input_type -> go.micro.store.WriteRequest + 9, // 10: go.micro.store.Store.Delete:input_type -> go.micro.store.DeleteRequest + 12, // 11: go.micro.store.Store.List:input_type -> go.micro.store.ListRequest + 14, // 12: go.micro.store.Store.Databases:input_type -> go.micro.store.DatabasesRequest + 16, // 13: go.micro.store.Store.Tables:input_type -> go.micro.store.TablesRequest + 4, // 14: go.micro.store.Store.Read:output_type -> go.micro.store.ReadResponse + 7, // 15: go.micro.store.Store.Write:output_type -> go.micro.store.WriteResponse + 10, // 16: go.micro.store.Store.Delete:output_type -> go.micro.store.DeleteResponse + 13, // 17: go.micro.store.Store.List:output_type -> go.micro.store.ListResponse + 15, // 18: go.micro.store.Store.Databases:output_type -> go.micro.store.DatabasesResponse + 17, // 19: go.micro.store.Store.Tables:output_type -> go.micro.store.TablesResponse + 14, // [14:20] is the sub-list for method output_type + 8, // [8:14] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } -type storeClient struct { - cc *grpc.ClientConn -} - -func NewStoreClient(cc *grpc.ClientConn) StoreClient { - return &storeClient{cc} -} - -func (c *storeClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) { - out := new(ReadResponse) - err := c.cc.Invoke(ctx, "/go.micro.store.Store/Read", in, out, opts...) - if err != nil { - return nil, err +func init() { file_github_com_micro_go_micro_store_service_proto_store_proto_init() } +func file_github_com_micro_go_micro_store_service_proto_store_proto_init() { + if File_github_com_micro_go_micro_store_service_proto_store_proto != nil { + return } - return out, nil -} - -func (c *storeClient) Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) { - out := new(WriteResponse) - err := c.cc.Invoke(ctx, "/go.micro.store.Store/Write", in, out, opts...) - if err != nil { - return nil, err + if !protoimpl.UnsafeEnabled { + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Field); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DatabasesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DatabasesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TablesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - return out, nil -} - -func (c *storeClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { - out := new(DeleteResponse) - err := c.cc.Invoke(ctx, "/go.micro.store.Store/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (Store_ListClient, error) { - stream, err := c.cc.NewStream(ctx, &_Store_serviceDesc.Streams[0], "/go.micro.store.Store/List", opts...) - if err != nil { - return nil, err - } - x := &storeListClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Store_ListClient interface { - Recv() (*ListResponse, error) - grpc.ClientStream -} - -type storeListClient struct { - grpc.ClientStream -} - -func (x *storeListClient) Recv() (*ListResponse, error) { - m := new(ListResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storeClient) Databases(ctx context.Context, in *DatabasesRequest, opts ...grpc.CallOption) (*DatabasesResponse, error) { - out := new(DatabasesResponse) - err := c.cc.Invoke(ctx, "/go.micro.store.Store/Databases", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) Tables(ctx context.Context, in *TablesRequest, opts ...grpc.CallOption) (*TablesResponse, error) { - out := new(TablesResponse) - err := c.cc.Invoke(ctx, "/go.micro.store.Store/Tables", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StoreServer is the server API for Store service. -type StoreServer interface { - Read(context.Context, *ReadRequest) (*ReadResponse, error) - Write(context.Context, *WriteRequest) (*WriteResponse, error) - Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) - List(*ListRequest, Store_ListServer) error - Databases(context.Context, *DatabasesRequest) (*DatabasesResponse, error) - Tables(context.Context, *TablesRequest) (*TablesResponse, error) -} - -// UnimplementedStoreServer can be embedded to have forward compatible implementations. -type UnimplementedStoreServer struct { -} - -func (*UnimplementedStoreServer) Read(ctx context.Context, req *ReadRequest) (*ReadResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") -} -func (*UnimplementedStoreServer) Write(ctx context.Context, req *WriteRequest) (*WriteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") -} -func (*UnimplementedStoreServer) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (*UnimplementedStoreServer) List(req *ListRequest, srv Store_ListServer) error { - return status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (*UnimplementedStoreServer) Databases(ctx context.Context, req *DatabasesRequest) (*DatabasesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Databases not implemented") -} -func (*UnimplementedStoreServer) Tables(ctx context.Context, req *TablesRequest) (*TablesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Tables not implemented") -} - -func RegisterStoreServer(s *grpc.Server, srv StoreServer) { - s.RegisterService(&_Store_serviceDesc, srv) -} - -func _Store_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Read(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.store.Store/Read", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Read(ctx, req.(*ReadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WriteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Write(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.store.Store/Write", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Write(ctx, req.(*WriteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.store.Store/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_List_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(StoreServer).List(m, &storeListServer{stream}) -} - -type Store_ListServer interface { - Send(*ListResponse) error - grpc.ServerStream -} - -type storeListServer struct { - grpc.ServerStream -} - -func (x *storeListServer) Send(m *ListResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Store_Databases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DatabasesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Databases(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.store.Store/Databases", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Databases(ctx, req.(*DatabasesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_Tables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TablesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Tables(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/go.micro.store.Store/Tables", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Tables(ctx, req.(*TablesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Store_serviceDesc = grpc.ServiceDesc{ - ServiceName: "go.micro.store.Store", - HandlerType: (*StoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Read", - Handler: _Store_Read_Handler, + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc, + NumEnums: 0, + NumMessages: 19, + NumExtensions: 0, + NumServices: 1, }, - { - MethodName: "Write", - Handler: _Store_Write_Handler, - }, - { - MethodName: "Delete", - Handler: _Store_Delete_Handler, - }, - { - MethodName: "Databases", - Handler: _Store_Databases_Handler, - }, - { - MethodName: "Tables", - Handler: _Store_Tables_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "List", - Handler: _Store_List_Handler, - ServerStreams: true, - }, - }, - Metadata: "store/service/proto/store.proto", + GoTypes: file_github_com_micro_go_micro_store_service_proto_store_proto_goTypes, + DependencyIndexes: file_github_com_micro_go_micro_store_service_proto_store_proto_depIdxs, + MessageInfos: file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes, + }.Build() + File_github_com_micro_go_micro_store_service_proto_store_proto = out.File + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc = nil + file_github_com_micro_go_micro_store_service_proto_store_proto_goTypes = nil + file_github_com_micro_go_micro_store_service_proto_store_proto_depIdxs = nil } diff --git a/store/service/proto/store.pb.micro.go b/store/service/proto/store.pb.micro.go index 0e622f09..668a5a87 100644 --- a/store/service/proto/store.pb.micro.go +++ b/store/service/proto/store.pb.micro.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-micro. DO NOT EDIT. -// source: store/service/proto/store.proto +// source: github.com/micro/go-micro/store/service/proto/store.proto package go_micro_store diff --git a/store/service/proto/store.proto b/store/service/proto/store.proto index 22056ef9..80fbc40f 100644 --- a/store/service/proto/store.proto +++ b/store/service/proto/store.proto @@ -11,6 +11,13 @@ service Store { rpc Tables(TablesRequest) returns (TablesResponse) {}; } +message Field { + // type of value e.g string, int, int64, bool, float64 + string type = 1; + // the actual value + string value = 2; +} + message Record { // key of the record string key = 1; @@ -18,6 +25,8 @@ message Record { bytes value = 2; // time.Duration (signed int64 nanoseconds) int64 expiry = 3; + // the associated metadata + map metadata = 4; } message ReadOptions { diff --git a/store/service/service.go b/store/service/service.go index 60adbb9e..94fb7dd3 100644 --- a/store/service/service.go +++ b/store/service/service.go @@ -3,7 +3,9 @@ package service import ( "context" + "fmt" "io" + "reflect" "time" "github.com/micro/go-micro/v2/client" @@ -137,10 +139,21 @@ func (s *serviceStore) Read(key string, opts ...store.ReadOption) ([]*store.Reco records := make([]*store.Record, 0, len(rsp.Records)) for _, val := range rsp.Records { + metadata := make(map[string]interface{}) + + for k, v := range val.Metadata { + switch v.Type { + // TODO: parse all types + default: + metadata[k] = v + } + } + records = append(records, &store.Record{ - Key: val.Key, - Value: val.Value, - Expiry: time.Duration(val.Expiry) * time.Second, + Key: val.Key, + Value: val.Value, + Expiry: time.Duration(val.Expiry) * time.Second, + Metadata: metadata, }) } @@ -163,11 +176,21 @@ func (s *serviceStore) Write(record *store.Record, opts ...store.WriteOption) er Table: options.Table, } + metadata := make(map[string]*pb.Field) + + for k, v := range record.Metadata { + metadata[k] = &pb.Field{ + Type: reflect.TypeOf(v).String(), + Value: fmt.Sprintf("%v", v), + } + } + _, err := s.Client.Write(s.Context(), &pb.WriteRequest{ Record: &pb.Record{ - Key: record.Key, - Value: record.Value, - Expiry: int64(record.Expiry.Seconds()), + Key: record.Key, + Value: record.Value, + Expiry: int64(record.Expiry.Seconds()), + Metadata: metadata, }, Options: writeOpts}, client.WithAddress(s.Nodes...)) if err != nil && errors.Equal(err, errors.NotFound("", "")) { diff --git a/store/store.go b/store/store.go index c949f939..9127f077 100644 --- a/store/store.go +++ b/store/store.go @@ -36,7 +36,12 @@ type Store interface { // Record is an item stored or retrieved from a Store type Record struct { - Key string `json:"key"` - Value []byte `json:"value"` + // The key to store the record + Key string `json:"key"` + // The value within the record + Value []byte `json:"value"` + // Any associated metadata for indexing + Metadata map[string]interface{} `json:"metadata"` + // Time to expire a record: TODO: change to timestamp Expiry time.Duration `json:"expiry,omitempty"` }