diff --git a/ocs/pkg/service/v0/users.go b/ocs/pkg/service/v0/users.go index 256109a41..cf55f10ee 100644 --- a/ocs/pkg/service/v0/users.go +++ b/ocs/pkg/service/v0/users.go @@ -13,6 +13,9 @@ import ( accountsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/accounts/v1" accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v1" + storemsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/store/v1" + storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1" + "github.com/asim/go-micro/plugins/client/grpc/v4" revauser "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" @@ -27,7 +30,6 @@ import ( "github.com/owncloud/ocis/ocs/pkg/service/v0/data" "github.com/owncloud/ocis/ocs/pkg/service/v0/response" ocstracing "github.com/owncloud/ocis/ocs/pkg/tracing" - storepb "github.com/owncloud/ocis/store/pkg/proto/v0" "github.com/pkg/errors" merrors "go-micro.dev/v4/errors" "google.golang.org/genproto/protobuf/field_mask" @@ -653,9 +655,9 @@ func (o Ocs) GetSigningKey(w http.ResponseWriter, r *http.Request) { // use the user's UUID userID := u.Id.OpaqueId - c := storepb.NewStoreService("com.owncloud.api.store", grpc.NewClient()) - res, err := c.Read(r.Context(), &storepb.ReadRequest{ - Options: &storepb.ReadOptions{ + c := storesvc.NewStoreService("com.owncloud.api.store", grpc.NewClient()) + res, err := c.Read(r.Context(), &storesvc.ReadRequest{ + Options: &storemsg.ReadOptions{ Database: "proxy", Table: "signing-keys", }, @@ -687,12 +689,12 @@ func (o Ocs) GetSigningKey(w http.ResponseWriter, r *http.Request) { } signingKey := hex.EncodeToString(key) - _, err = c.Write(r.Context(), &storepb.WriteRequest{ - Options: &storepb.WriteOptions{ + _, err = c.Write(r.Context(), &storesvc.WriteRequest{ + Options: &storemsg.WriteOptions{ Database: "proxy", Table: "signing-keys", }, - Record: &storepb.Record{ + Record: &storemsg.Record{ Key: userID, Value: []byte(signingKey), // TODO Expiry? diff --git a/proxy/pkg/command/server.go b/proxy/pkg/command/server.go index fae2570ba..787e39834 100644 --- a/proxy/pkg/command/server.go +++ b/proxy/pkg/command/server.go @@ -9,6 +9,8 @@ import ( accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v1" + storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1" + "github.com/coreos/go-oidc/v3/oidc" "github.com/cs3org/reva/pkg/token/manager/jwt" chimiddleware "github.com/go-chi/chi/v5/middleware" @@ -30,7 +32,6 @@ import ( proxyHTTP "github.com/owncloud/ocis/proxy/pkg/server/http" "github.com/owncloud/ocis/proxy/pkg/tracing" "github.com/owncloud/ocis/proxy/pkg/user/backend" - storepb "github.com/owncloud/ocis/store/pkg/proto/v0" "github.com/urfave/cli/v2" "golang.org/x/oauth2" ) @@ -152,7 +153,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) logger.Fatal().Msgf("Invalid accounts backend type '%s'", cfg.AccountBackend) } - storeClient := storepb.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) + storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) if err != nil { logger.Error().Err(err). Str("gateway", cfg.Reva.Address). diff --git a/proxy/pkg/middleware/options.go b/proxy/pkg/middleware/options.go index bf3135403..8486f5a4a 100644 --- a/proxy/pkg/middleware/options.go +++ b/proxy/pkg/middleware/options.go @@ -8,11 +8,11 @@ import ( accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v1" settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" + storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/proxy/pkg/config" - storepb "github.com/owncloud/ocis/store/pkg/proto/v0" ) // Option defines a single option function. @@ -41,7 +41,7 @@ type Options struct { // RevaGatewayClient to send requests to the reva gateway RevaGatewayClient gateway.GatewayAPIClient // Store for persisting data - Store storepb.StoreService + Store storesvc.StoreService // PreSignedURLConfig to configure the middleware PreSignedURLConfig config.PreSignedURL // UserOIDCClaim to read from the oidc claims @@ -142,7 +142,7 @@ func RevaGatewayClient(gc gateway.GatewayAPIClient) Option { } // Store provides a function to set the store option. -func Store(sc storepb.StoreService) Option { +func Store(sc storesvc.StoreService) Option { return func(o *Options) { o.Store = sc } diff --git a/proxy/pkg/middleware/signed_url_auth.go b/proxy/pkg/middleware/signed_url_auth.go index 6eccbab15..5abc9df02 100644 --- a/proxy/pkg/middleware/signed_url_auth.go +++ b/proxy/pkg/middleware/signed_url_auth.go @@ -13,9 +13,10 @@ import ( revactx "github.com/cs3org/reva/pkg/ctx" "github.com/owncloud/ocis/ocis-pkg/log" + storemsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/store/v1" + storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1" "github.com/owncloud/ocis/proxy/pkg/config" "github.com/owncloud/ocis/proxy/pkg/user/backend" - store "github.com/owncloud/ocis/store/pkg/proto/v0" "golang.org/x/crypto/pbkdf2" ) @@ -39,7 +40,7 @@ type signedURLAuth struct { logger log.Logger preSignedURLConfig config.PreSignedURL userProvider backend.UserBackend - store store.StoreService + store storesvc.StoreService } func (m signedURLAuth) ServeHTTP(w http.ResponseWriter, req *http.Request) { @@ -197,8 +198,8 @@ func (m signedURLAuth) createSignature(url string, signingKey []byte) string { } func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { - res, err := m.store.Read(ctx, &store.ReadRequest{ - Options: &store.ReadOptions{ + res, err := m.store.Read(ctx, &storesvc.ReadRequest{ + Options: &storemsg.ReadOptions{ Database: "proxy", Table: "signing-keys", }, diff --git a/store/pkg/proto/v0/store.pb.go b/store/pkg/proto/v0/store.pb.go deleted file mode 100644 index 8c971170b..000000000 --- a/store/pkg/proto/v0/store.pb.go +++ /dev/null @@ -1,1510 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 -// source: proto/v0/store.proto - -package proto - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type 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_proto_v0_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_proto_v0_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_proto_v0_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 recorda - 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"` - // 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 (x *Record) Reset() { - *x = Record{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{1} -} - -func (x *Record) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Record) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -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 { - 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"` - Where map[string]*Field `protobuf:"bytes,7,rep,name=where,proto3" json:"where,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ReadOptions) Reset() { - *x = ReadOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{2} -} - -func (x *ReadOptions) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *ReadOptions) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *ReadOptions) GetPrefix() bool { - if x != nil { - return x.Prefix - } - return false -} - -func (x *ReadOptions) GetSuffix() bool { - if x != nil { - return x.Suffix - } - return false -} - -func (x *ReadOptions) GetLimit() uint64 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *ReadOptions) GetOffset() uint64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ReadOptions) GetWhere() map[string]*Field { - if x != nil { - return x.Where - } - return nil -} - -type ReadRequest struct { - 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 (x *ReadRequest) Reset() { - *x = ReadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{3} -} - -func (x *ReadRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ReadRequest) GetOptions() *ReadOptions { - if x != nil { - return x.Options - } - return nil -} - -type ReadResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` -} - -func (x *ReadResponse) Reset() { - *x = ReadResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{4} -} - -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"` -} - -func (x *WriteOptions) Reset() { - *x = WriteOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{5} -} - -func (x *WriteOptions) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *WriteOptions) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *WriteOptions) GetExpiry() int64 { - if x != nil { - return x.Expiry - } - return 0 -} - -func (x *WriteOptions) GetTtl() int64 { - if x != nil { - return x.Ttl - } - return 0 -} - -type WriteRequest struct { - 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 (x *WriteRequest) Reset() { - *x = WriteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{6} -} - -func (x *WriteRequest) GetRecord() *Record { - if x != nil { - return x.Record - } - return nil -} - -func (x *WriteRequest) GetOptions() *WriteOptions { - if x != nil { - return x.Options - } - return nil -} - -type WriteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *WriteResponse) Reset() { - *x = WriteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{7} -} - -type DeleteOptions 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"` -} - -func (x *DeleteOptions) Reset() { - *x = DeleteOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{8} -} - -func (x *DeleteOptions) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *DeleteOptions) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -type DeleteRequest struct { - 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 (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{9} -} - -func (x *DeleteRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *DeleteRequest) GetOptions() *DeleteOptions { - if x != nil { - return x.Options - } - return nil -} - -type DeleteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteResponse) Reset() { - *x = DeleteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{10} -} - -type ListOptions 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"` - 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 (x *ListOptions) Reset() { - *x = ListOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{11} -} - -func (x *ListOptions) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *ListOptions) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *ListOptions) GetPrefix() string { - if x != nil { - return x.Prefix - } - return "" -} - -func (x *ListOptions) GetSuffix() string { - if x != nil { - return x.Suffix - } - return "" -} - -func (x *ListOptions) GetLimit() uint64 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *ListOptions) GetOffset() uint64 { - if x != nil { - return x.Offset - } - return 0 -} - -type ListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Options *ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *ListRequest) Reset() { - *x = ListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{12} -} - -func (x *ListRequest) GetOptions() *ListOptions { - if x != nil { - return x.Options - } - return nil -} - -type ListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` -} - -func (x *ListResponse) Reset() { - *x = ListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{13} -} - -func (x *ListResponse) GetKeys() []string { - if x != nil { - return x.Keys - } - return nil -} - -type DatabasesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DatabasesRequest) Reset() { - *x = DatabasesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{14} -} - -type DatabasesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Databases []string `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"` -} - -func (x *DatabasesResponse) Reset() { - *x = DatabasesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{15} -} - -func (x *DatabasesResponse) GetDatabases() []string { - if x != nil { - return x.Databases - } - return nil -} - -type TablesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` -} - -func (x *TablesRequest) Reset() { - *x = TablesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{16} -} - -func (x *TablesRequest) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -type TablesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` -} - -func (x *TablesResponse) Reset() { - *x = TablesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_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_proto_v0_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 file_proto_v0_store_proto_rawDescGZIP(), []int{17} -} - -func (x *TablesResponse) GetTables() []string { - if x != nil { - return x.Tables - } - return nil -} - -var File_proto_v0_store_proto protoreflect.FileDescriptor - -var file_proto_v0_store_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x30, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 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, 0xf6, 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, 0x4c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 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, 0x5e, - 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, 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc4, - 0x02, 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, 0x12, 0x48, - 0x0a, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, - 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x57, 0x68, 0x65, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x1a, 0x5b, 0x0a, 0x0a, 0x57, 0x68, 0x65, 0x72, - 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, - 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x62, 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, 0x41, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, - 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x4c, 0x0a, 0x0c, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 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, 0x8e, 0x01, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x30, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x12, 0x42, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 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, 0x66, 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, 0x43, 0x0a, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 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, 0x50, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x41, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 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, 0xd5, 0x04, 0x0a, - 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x5b, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x27, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x61, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, - 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x28, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x30, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x29, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, - 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, - 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x6a, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, - 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, - 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x44, 0x61, - 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x61, 0x0a, 0x06, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x30, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x30, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x42, 0xd1, 0x02, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, - 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x76, 0x30, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x92, 0x41, 0x9a, 0x02, 0x12, 0xb3, - 0x01, 0x0a, 0x1d, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x49, 0x6e, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x65, 0x20, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x22, 0x47, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x47, 0x6d, 0x62, - 0x48, 0x12, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, - 0x63, 0x69, 0x73, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x42, 0x0a, 0x0a, 0x41, 0x70, 0x61, - 0x63, 0x68, 0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, - 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x05, 0x31, - 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x0a, 0x10, - 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x20, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, - 0x12, 0x26, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_v0_store_proto_rawDescOnce sync.Once - file_proto_v0_store_proto_rawDescData = file_proto_v0_store_proto_rawDesc -) - -func file_proto_v0_store_proto_rawDescGZIP() []byte { - file_proto_v0_store_proto_rawDescOnce.Do(func() { - file_proto_v0_store_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_v0_store_proto_rawDescData) - }) - return file_proto_v0_store_proto_rawDescData -} - -var file_proto_v0_store_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_proto_v0_store_proto_goTypes = []interface{}{ - (*Field)(nil), // 0: com.owncloud.ocis.store.v0.Field - (*Record)(nil), // 1: com.owncloud.ocis.store.v0.Record - (*ReadOptions)(nil), // 2: com.owncloud.ocis.store.v0.ReadOptions - (*ReadRequest)(nil), // 3: com.owncloud.ocis.store.v0.ReadRequest - (*ReadResponse)(nil), // 4: com.owncloud.ocis.store.v0.ReadResponse - (*WriteOptions)(nil), // 5: com.owncloud.ocis.store.v0.WriteOptions - (*WriteRequest)(nil), // 6: com.owncloud.ocis.store.v0.WriteRequest - (*WriteResponse)(nil), // 7: com.owncloud.ocis.store.v0.WriteResponse - (*DeleteOptions)(nil), // 8: com.owncloud.ocis.store.v0.DeleteOptions - (*DeleteRequest)(nil), // 9: com.owncloud.ocis.store.v0.DeleteRequest - (*DeleteResponse)(nil), // 10: com.owncloud.ocis.store.v0.DeleteResponse - (*ListOptions)(nil), // 11: com.owncloud.ocis.store.v0.ListOptions - (*ListRequest)(nil), // 12: com.owncloud.ocis.store.v0.ListRequest - (*ListResponse)(nil), // 13: com.owncloud.ocis.store.v0.ListResponse - (*DatabasesRequest)(nil), // 14: com.owncloud.ocis.store.v0.DatabasesRequest - (*DatabasesResponse)(nil), // 15: com.owncloud.ocis.store.v0.DatabasesResponse - (*TablesRequest)(nil), // 16: com.owncloud.ocis.store.v0.TablesRequest - (*TablesResponse)(nil), // 17: com.owncloud.ocis.store.v0.TablesResponse - nil, // 18: com.owncloud.ocis.store.v0.Record.MetadataEntry - nil, // 19: com.owncloud.ocis.store.v0.ReadOptions.WhereEntry -} -var file_proto_v0_store_proto_depIdxs = []int32{ - 18, // 0: com.owncloud.ocis.store.v0.Record.metadata:type_name -> com.owncloud.ocis.store.v0.Record.MetadataEntry - 19, // 1: com.owncloud.ocis.store.v0.ReadOptions.where:type_name -> com.owncloud.ocis.store.v0.ReadOptions.WhereEntry - 2, // 2: com.owncloud.ocis.store.v0.ReadRequest.options:type_name -> com.owncloud.ocis.store.v0.ReadOptions - 1, // 3: com.owncloud.ocis.store.v0.ReadResponse.records:type_name -> com.owncloud.ocis.store.v0.Record - 1, // 4: com.owncloud.ocis.store.v0.WriteRequest.record:type_name -> com.owncloud.ocis.store.v0.Record - 5, // 5: com.owncloud.ocis.store.v0.WriteRequest.options:type_name -> com.owncloud.ocis.store.v0.WriteOptions - 8, // 6: com.owncloud.ocis.store.v0.DeleteRequest.options:type_name -> com.owncloud.ocis.store.v0.DeleteOptions - 11, // 7: com.owncloud.ocis.store.v0.ListRequest.options:type_name -> com.owncloud.ocis.store.v0.ListOptions - 0, // 8: com.owncloud.ocis.store.v0.Record.MetadataEntry.value:type_name -> com.owncloud.ocis.store.v0.Field - 0, // 9: com.owncloud.ocis.store.v0.ReadOptions.WhereEntry.value:type_name -> com.owncloud.ocis.store.v0.Field - 3, // 10: com.owncloud.ocis.store.v0.Store.Read:input_type -> com.owncloud.ocis.store.v0.ReadRequest - 6, // 11: com.owncloud.ocis.store.v0.Store.Write:input_type -> com.owncloud.ocis.store.v0.WriteRequest - 9, // 12: com.owncloud.ocis.store.v0.Store.Delete:input_type -> com.owncloud.ocis.store.v0.DeleteRequest - 12, // 13: com.owncloud.ocis.store.v0.Store.List:input_type -> com.owncloud.ocis.store.v0.ListRequest - 14, // 14: com.owncloud.ocis.store.v0.Store.Databases:input_type -> com.owncloud.ocis.store.v0.DatabasesRequest - 16, // 15: com.owncloud.ocis.store.v0.Store.Tables:input_type -> com.owncloud.ocis.store.v0.TablesRequest - 4, // 16: com.owncloud.ocis.store.v0.Store.Read:output_type -> com.owncloud.ocis.store.v0.ReadResponse - 7, // 17: com.owncloud.ocis.store.v0.Store.Write:output_type -> com.owncloud.ocis.store.v0.WriteResponse - 10, // 18: com.owncloud.ocis.store.v0.Store.Delete:output_type -> com.owncloud.ocis.store.v0.DeleteResponse - 13, // 19: com.owncloud.ocis.store.v0.Store.List:output_type -> com.owncloud.ocis.store.v0.ListResponse - 15, // 20: com.owncloud.ocis.store.v0.Store.Databases:output_type -> com.owncloud.ocis.store.v0.DatabasesResponse - 17, // 21: com.owncloud.ocis.store.v0.Store.Tables:output_type -> com.owncloud.ocis.store.v0.TablesResponse - 16, // [16:22] is the sub-list for method output_type - 10, // [10:16] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name -} - -func init() { file_proto_v0_store_proto_init() } -func file_proto_v0_store_proto_init() { - if File_proto_v0_store_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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_proto_v0_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 - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_v0_store_proto_rawDesc, - NumEnums: 0, - NumMessages: 20, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_v0_store_proto_goTypes, - DependencyIndexes: file_proto_v0_store_proto_depIdxs, - MessageInfos: file_proto_v0_store_proto_msgTypes, - }.Build() - File_proto_v0_store_proto = out.File - file_proto_v0_store_proto_rawDesc = nil - file_proto_v0_store_proto_goTypes = nil - file_proto_v0_store_proto_depIdxs = nil -} diff --git a/store/pkg/proto/v0/store.pb.micro.go b/store/pkg/proto/v0/store.pb.micro.go deleted file mode 100644 index 6d252879d..000000000 --- a/store/pkg/proto/v0/store.pb.micro.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/v0/store.proto - -package proto - -import ( - fmt "fmt" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - proto "google.golang.org/protobuf/proto" - math "math" -) - -import ( - context "context" - api "go-micro.dev/v4/api" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for Store service - -func NewStoreEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for Store service - -type StoreService interface { - Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) - Write(ctx context.Context, in *WriteRequest, opts ...client.CallOption) (*WriteResponse, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) - List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (Store_ListService, error) - Databases(ctx context.Context, in *DatabasesRequest, opts ...client.CallOption) (*DatabasesResponse, error) - Tables(ctx context.Context, in *TablesRequest, opts ...client.CallOption) (*TablesResponse, error) -} - -type storeService struct { - c client.Client - name string -} - -func NewStoreService(name string, c client.Client) StoreService { - return &storeService{ - c: c, - name: name, - } -} - -func (c *storeService) Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) { - req := c.c.NewRequest(c.name, "Store.Read", in) - out := new(ReadResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeService) Write(ctx context.Context, in *WriteRequest, opts ...client.CallOption) (*WriteResponse, error) { - req := c.c.NewRequest(c.name, "Store.Write", in) - out := new(WriteResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) { - req := c.c.NewRequest(c.name, "Store.Delete", in) - out := new(DeleteResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (Store_ListService, error) { - req := c.c.NewRequest(c.name, "Store.List", &ListRequest{}) - stream, err := c.c.Stream(ctx, req, opts...) - if err != nil { - return nil, err - } - if err := stream.Send(in); err != nil { - return nil, err - } - return &storeServiceList{stream}, nil -} - -type Store_ListService interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Recv() (*ListResponse, error) -} - -type storeServiceList struct { - stream client.Stream -} - -func (x *storeServiceList) Close() error { - return x.stream.Close() -} - -func (x *storeServiceList) Context() context.Context { - return x.stream.Context() -} - -func (x *storeServiceList) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *storeServiceList) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *storeServiceList) Recv() (*ListResponse, error) { - m := new(ListResponse) - err := x.stream.Recv(m) - if err != nil { - return nil, err - } - return m, nil -} - -func (c *storeService) Databases(ctx context.Context, in *DatabasesRequest, opts ...client.CallOption) (*DatabasesResponse, error) { - req := c.c.NewRequest(c.name, "Store.Databases", in) - out := new(DatabasesResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeService) Tables(ctx context.Context, in *TablesRequest, opts ...client.CallOption) (*TablesResponse, error) { - req := c.c.NewRequest(c.name, "Store.Tables", in) - out := new(TablesResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Store service - -type StoreHandler interface { - Read(context.Context, *ReadRequest, *ReadResponse) error - Write(context.Context, *WriteRequest, *WriteResponse) error - Delete(context.Context, *DeleteRequest, *DeleteResponse) error - List(context.Context, *ListRequest, Store_ListStream) error - Databases(context.Context, *DatabasesRequest, *DatabasesResponse) error - Tables(context.Context, *TablesRequest, *TablesResponse) error -} - -func RegisterStoreHandler(s server.Server, hdlr StoreHandler, opts ...server.HandlerOption) error { - type store interface { - Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error - Write(ctx context.Context, in *WriteRequest, out *WriteResponse) error - Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error - List(ctx context.Context, stream server.Stream) error - Databases(ctx context.Context, in *DatabasesRequest, out *DatabasesResponse) error - Tables(ctx context.Context, in *TablesRequest, out *TablesResponse) error - } - type Store struct { - store - } - h := &storeHandler{hdlr} - return s.Handle(s.NewHandler(&Store{h}, opts...)) -} - -type storeHandler struct { - StoreHandler -} - -func (h *storeHandler) Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error { - return h.StoreHandler.Read(ctx, in, out) -} - -func (h *storeHandler) Write(ctx context.Context, in *WriteRequest, out *WriteResponse) error { - return h.StoreHandler.Write(ctx, in, out) -} - -func (h *storeHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error { - return h.StoreHandler.Delete(ctx, in, out) -} - -func (h *storeHandler) List(ctx context.Context, stream server.Stream) error { - m := new(ListRequest) - if err := stream.Recv(m); err != nil { - return err - } - return h.StoreHandler.List(ctx, m, &storeListStream{stream}) -} - -type Store_ListStream interface { - Context() context.Context - SendMsg(interface{}) error - RecvMsg(interface{}) error - Close() error - Send(*ListResponse) error -} - -type storeListStream struct { - stream server.Stream -} - -func (x *storeListStream) Close() error { - return x.stream.Close() -} - -func (x *storeListStream) Context() context.Context { - return x.stream.Context() -} - -func (x *storeListStream) SendMsg(m interface{}) error { - return x.stream.Send(m) -} - -func (x *storeListStream) RecvMsg(m interface{}) error { - return x.stream.Recv(m) -} - -func (x *storeListStream) Send(m *ListResponse) error { - return x.stream.Send(m) -} - -func (h *storeHandler) Databases(ctx context.Context, in *DatabasesRequest, out *DatabasesResponse) error { - return h.StoreHandler.Databases(ctx, in, out) -} - -func (h *storeHandler) Tables(ctx context.Context, in *TablesRequest, out *TablesResponse) error { - return h.StoreHandler.Tables(ctx, in, out) -} diff --git a/store/pkg/proto/v0/store.swagger.json b/store/pkg/proto/v0/store.swagger.json deleted file mode 100644 index 2beaed54c..000000000 --- a/store/pkg/proto/v0/store.swagger.json +++ /dev/null @@ -1,242 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "ownCloud Infinite Scale store", - "version": "1.0.0", - "contact": { - "name": "ownCloud GmbH", - "url": "https://github.com/owncloud/ocis", - "email": "support@owncloud.com" - }, - "license": { - "name": "Apache-2.0", - "url": "https://github.com/owncloud/ocis/blob/master/LICENSE" - } - }, - "tags": [ - { - "name": "Store" - } - ], - "schemes": [ - "http", - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v0DatabasesResponse": { - "type": "object", - "properties": { - "databases": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v0DeleteOptions": { - "type": "object", - "properties": { - "database": { - "type": "string" - }, - "table": { - "type": "string" - } - } - }, - "v0DeleteResponse": { - "type": "object" - }, - "v0Field": { - "type": "object", - "properties": { - "type": { - "type": "string", - "title": "type of value e.g string, int, int64, bool, float64" - }, - "value": { - "type": "string", - "title": "the actual value" - } - } - }, - "v0ListOptions": { - "type": "object", - "properties": { - "database": { - "type": "string" - }, - "table": { - "type": "string" - }, - "prefix": { - "type": "string" - }, - "suffix": { - "type": "string" - }, - "limit": { - "type": "string", - "format": "uint64" - }, - "offset": { - "type": "string", - "format": "uint64" - } - } - }, - "v0ListResponse": { - "type": "object", - "properties": { - "keys": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v0ReadOptions": { - "type": "object", - "properties": { - "database": { - "type": "string" - }, - "table": { - "type": "string" - }, - "prefix": { - "type": "boolean" - }, - "suffix": { - "type": "boolean" - }, - "limit": { - "type": "string", - "format": "uint64" - }, - "offset": { - "type": "string", - "format": "uint64" - }, - "where": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v0Field" - } - } - } - }, - "v0ReadResponse": { - "type": "object", - "properties": { - "records": { - "type": "array", - "items": { - "$ref": "#/definitions/v0Record" - } - } - } - }, - "v0Record": { - "type": "object", - "properties": { - "key": { - "type": "string", - "title": "key of the recorda" - }, - "value": { - "type": "string", - "format": "byte", - "title": "value in the record" - }, - "expiry": { - "type": "string", - "format": "int64", - "title": "time.Duration (signed int64 nanoseconds)" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v0Field" - }, - "title": "the associated metadata" - } - } - }, - "v0TablesResponse": { - "type": "object", - "properties": { - "tables": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v0WriteOptions": { - "type": "object", - "properties": { - "database": { - "type": "string" - }, - "table": { - "type": "string" - }, - "expiry": { - "type": "string", - "format": "int64", - "title": "time.Time" - }, - "ttl": { - "type": "string", - "format": "int64", - "title": "time.Duration" - } - } - }, - "v0WriteResponse": { - "type": "object" - } - }, - "externalDocs": { - "description": "Developer Manual", - "url": "https://owncloud.dev/extensions/store/" - } -} diff --git a/store/pkg/server/grpc/server.go b/store/pkg/server/grpc/server.go index 632505486..2e3cdcdb2 100644 --- a/store/pkg/server/grpc/server.go +++ b/store/pkg/server/grpc/server.go @@ -3,7 +3,7 @@ package grpc import ( "github.com/owncloud/ocis/ocis-pkg/service/grpc" "github.com/owncloud/ocis/ocis-pkg/version" - "github.com/owncloud/ocis/store/pkg/proto/v0" + storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1" svc "github.com/owncloud/ocis/store/pkg/service/v0" ) @@ -28,7 +28,7 @@ func Server(opts ...Option) grpc.Service { if err != nil { options.Logger.Fatal().Err(err).Msg("could not initialize service handler") } - if err = proto.RegisterStoreHandler(service.Server(), hdlr); err != nil { + if err = storesvc.RegisterStoreHandler(service.Server(), hdlr); err != nil { options.Logger.Fatal().Err(err).Msg("could not register service handler") } diff --git a/store/pkg/service/v0/service.go b/store/pkg/service/v0/service.go index b86033f1d..bed2728da 100644 --- a/store/pkg/service/v0/service.go +++ b/store/pkg/service/v0/service.go @@ -10,17 +10,18 @@ import ( "github.com/blevesearch/bleve/v2" "github.com/blevesearch/bleve/v2/analysis/analyzer/keyword" "github.com/owncloud/ocis/ocis-pkg/log" + storemsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/store/v1" + storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1" "github.com/owncloud/ocis/store/pkg/config" - "github.com/owncloud/ocis/store/pkg/proto/v0" merrors "go-micro.dev/v4/errors" "google.golang.org/protobuf/encoding/protojson" ) // BleveDocument wraps the generated Record.Metadata and adds a property that is used to distinguish documents in the index. type BleveDocument struct { - Metadata map[string]*proto.Field `json:"metadata"` - Database string `json:"database"` - Table string `json:"table"` + Metadata map[string]*storemsg.Field `json:"metadata"` + Database string `json:"database"` + Table string `json:"table"` } // New returns a new instance of Service @@ -77,13 +78,13 @@ type Service struct { } // Read implements the StoreHandler interface. -func (s *Service) Read(c context.Context, rreq *proto.ReadRequest, rres *proto.ReadResponse) error { +func (s *Service) Read(c context.Context, rreq *storesvc.ReadRequest, rres *storesvc.ReadResponse) error { if len(rreq.Key) != 0 { id := getID(rreq.Options.Database, rreq.Options.Table, rreq.Key) file := filepath.Join(s.Config.Datapath, "databases", id) var data []byte - rec := &proto.Record{} + rec := &storemsg.Record{} data, err := ioutil.ReadFile(file) if err != nil { return merrors.NotFound(s.id, "could not read record") @@ -123,7 +124,7 @@ func (s *Service) Read(c context.Context, rreq *proto.ReadRequest, rres *proto.R } for _, hit := range searchResult.Hits { - rec := &proto.Record{} + rec := &storemsg.Record{} dest := filepath.Join(s.Config.Datapath, "databases", hit.ID) @@ -148,7 +149,7 @@ func (s *Service) Read(c context.Context, rreq *proto.ReadRequest, rres *proto.R } // Write implements the StoreHandler interface. -func (s *Service) Write(c context.Context, wreq *proto.WriteRequest, wres *proto.WriteResponse) error { +func (s *Service) Write(c context.Context, wreq *storesvc.WriteRequest, wres *storesvc.WriteResponse) error { id := getID(wreq.Options.Database, wreq.Options.Table, wreq.Record.Key) file := filepath.Join(s.Config.Datapath, "databases", id) @@ -181,7 +182,7 @@ func (s *Service) Write(c context.Context, wreq *proto.WriteRequest, wres *proto } // Delete implements the StoreHandler interface. -func (s *Service) Delete(c context.Context, dreq *proto.DeleteRequest, dres *proto.DeleteResponse) error { +func (s *Service) Delete(c context.Context, dreq *storesvc.DeleteRequest, dres *storesvc.DeleteResponse) error { id := getID(dreq.Options.Database, dreq.Options.Table, dreq.Key) file := filepath.Join(s.Config.Datapath, "databases", id) if err := os.Remove(file); err != nil { @@ -201,12 +202,12 @@ func (s *Service) Delete(c context.Context, dreq *proto.DeleteRequest, dres *pro } // List implements the StoreHandler interface. -func (s *Service) List(context.Context, *proto.ListRequest, proto.Store_ListStream) error { +func (s *Service) List(context.Context, *storesvc.ListRequest, storesvc.Store_ListStream) error { return nil } // Databases implements the StoreHandler interface. -func (s *Service) Databases(c context.Context, dbreq *proto.DatabasesRequest, dbres *proto.DatabasesResponse) error { +func (s *Service) Databases(c context.Context, dbreq *storesvc.DatabasesRequest, dbres *storesvc.DatabasesResponse) error { file := filepath.Join(s.Config.Datapath, "databases") f, err := os.Open(file) if err != nil { @@ -224,7 +225,7 @@ func (s *Service) Databases(c context.Context, dbreq *proto.DatabasesRequest, db } // Tables implements the StoreHandler interface. -func (s *Service) Tables(ctx context.Context, in *proto.TablesRequest, out *proto.TablesResponse) error { +func (s *Service) Tables(ctx context.Context, in *storesvc.TablesRequest, out *storesvc.TablesResponse) error { file := filepath.Join(s.Config.Datapath, "databases", in.Database) f, err := os.Open(file) if err != nil { @@ -300,7 +301,7 @@ func (s Service) indexRecords(recordsDir string) (err error) { // read record var data []byte - rec := &proto.Record{} + rec := &storemsg.Record{} data, err = ioutil.ReadFile(kp) if err != nil { s.log.Error().Err(err).Str("id", id).Msg("could not read record") diff --git a/store/proto/v0/store.proto b/store/proto/v0/store.proto deleted file mode 100644 index 32dbfb304..000000000 --- a/store/proto/v0/store.proto +++ /dev/null @@ -1,138 +0,0 @@ -syntax = "proto3"; - -package com.owncloud.ocis.store.v0; - -option go_package = "github.com/owncloud/ocis/store/pkg/proto/v0;proto"; - -import "protoc-gen-openapiv2/options/annotations.proto"; - -option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { - info: { - title: "ownCloud Infinite Scale store"; - version: "1.0.0"; - contact: { - name: "ownCloud GmbH"; - url: "https://github.com/owncloud/ocis"; - email: "support@owncloud.com"; - }; - license: { - name: "Apache-2.0"; - url: "https://github.com/owncloud/ocis/blob/master/LICENSE"; - }; - }; - schemes: HTTP; - schemes: HTTPS; - consumes: "application/json"; - produces: "application/json"; - external_docs: { - description: "Developer Manual"; - url: "https://owncloud.dev/extensions/store/"; - }; -}; - -service Store { - rpc Read(ReadRequest) returns (ReadResponse) {}; - rpc Write(WriteRequest) returns (WriteResponse) {}; - rpc Delete(DeleteRequest) returns (DeleteResponse) {}; - rpc List(ListRequest) returns (stream ListResponse) {}; - rpc Databases(DatabasesRequest) returns (DatabasesResponse) {}; - 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 recorda - string key = 1; - // value in the record - bytes value = 2; - // time.Duration (signed int64 nanoseconds) - int64 expiry = 3; - // the associated metadata - map metadata = 4; -} - -message ReadOptions { - string database = 1; - string table = 2; - bool prefix = 3; - bool suffix = 4; - uint64 limit = 5; - uint64 offset = 6; - map where = 7; -} - -message ReadRequest { - string key = 1; - ReadOptions options = 2; -} - -message ReadResponse { - repeated Record records = 1; -} - -message WriteOptions { - string database = 1; - string table = 2; - // time.Time - int64 expiry = 3; - // time.Duration - int64 ttl = 4; -} - -message WriteRequest { - Record record = 1; - WriteOptions options = 2; -} - -message WriteResponse {} - -message DeleteOptions { - string database = 1; - string table = 2; -} - -message DeleteRequest { - string key = 1; - DeleteOptions options = 2; -} - -message DeleteResponse {} - -message ListOptions { - string database = 1; - string table = 2; - string prefix = 3; - string suffix = 4; - uint64 limit = 5; - uint64 offset = 6; -} - - -message ListRequest { - ListOptions options = 1; -} - -message ListResponse { - reserved 1; //repeated Record records = 1; - repeated string keys = 2; -} - -message DatabasesRequest {} - -message DatabasesResponse { - repeated string databases = 1; -} - -message TablesRequest { - string database = 1; -} - -message TablesResponse { - repeated string tables = 1; -}