From 9009e2d15467c63fc079dc174eb6fbe53ba2f723 Mon Sep 17 00:00:00 2001 From: andrei <18027129+akurilov@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:50:29 +0300 Subject: [PATCH] feat: search public interests --- .github/workflows/testing.yaml | 2 +- Makefile | 2 +- api/client.go | 6 +- api/client_test.go | 4 +- api/grpc/limits/service.pb.go | 6 +- api/grpc/permits/service.pb.go | 6 +- api/grpc/reader/service.pb.go | 4 +- api/grpc/resolver/service.pb.go | 4 +- api/grpc/subject/subject.pb.go | 4 +- api/grpc/subscriptions/client_mock.go | 20 + api/grpc/subscriptions/service.go | 53 +- api/grpc/subscriptions/service.pb.go | 791 ++++++++++++++++++++----- api/grpc/subscriptions/service.proto | 45 ++ api/grpc/subscriptions/service_mock.go | 4 +- api/grpc/subscriptions/service_test.go | 6 +- go.mod | 24 +- go.sum | 66 ++- model/subscription/cursor.go | 6 + model/subscription/data.go | 8 + model/subscription/query.go | 42 ++ 20 files changed, 867 insertions(+), 236 deletions(-) create mode 100644 model/subscription/cursor.go create mode 100644 model/subscription/query.go diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index c38a2db..5e4c4e3 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.21.0 + go-version: 1.22 - name: Install Protoc uses: arduino/setup-protoc@v1 diff --git a/Makefile b/Makefile index 3aa53e2..fd4405d 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ COVERAGE_TMP_FILE_NAME=cover.tmp proto: go install github.com/golang/protobuf/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 PATH=${PATH}:~/go/bin protoc --go_out=plugins=grpc:. --go_opt=paths=source_relative \ api/grpc/limits/*.proto \ api/grpc/permits/*.proto \ diff --git a/api/client.go b/api/client.go index 8ec4b99..90c5a37 100644 --- a/api/client.go +++ b/api/client.go @@ -55,7 +55,7 @@ type Client interface { DeleteSubscription(ctx context.Context, userId, subId string) (err error) // SearchSubscriptions returns all subscription ids those have the requested user id. - SearchSubscriptions(ctx context.Context, userId string, limit uint32, cursor string) (ids []string, err error) + SearchSubscriptions(ctx context.Context, userId string, q subscription.Query, cursor subscription.Cursor) (ids []string, err error) } type client struct { @@ -173,11 +173,11 @@ func (c client) DeleteSubscription(ctx context.Context, userId, subId string) (e return } -func (c client) SearchSubscriptions(ctx context.Context, userId string, limit uint32, cursor string) (ids []string, err error) { +func (c client) SearchSubscriptions(ctx context.Context, userId string, q subscription.Query, cursor subscription.Cursor) (ids []string, err error) { if c.svcSubs == nil { err = fmt.Errorf("%w: SearchSubscriptions(...)", ErrApiDisabled) } else { - ids, err = c.svcSubs.SearchOwn(ctx, userId, limit, cursor) + ids, err = c.svcSubs.Search(ctx, userId, q, cursor) } return } diff --git a/api/client_test.go b/api/client_test.go index 38b7d79..f6a84ff 100644 --- a/api/client_test.go +++ b/api/client_test.go @@ -690,7 +690,9 @@ func TestClient_SearchSubscriptions(t *testing.T) { svcSubs: c.svcSubs, } ctx := context.TODO() - ids, err := cl.SearchSubscriptions(ctx, "user0", 0, c.cursor) + ids, err := cl.SearchSubscriptions(ctx, "user0", subscription.Query{}, subscription.Cursor{ + Id: c.cursor, + }) assert.Equal(t, c.ids, ids) assert.ErrorIs(t, err, c.err) assert.Nil(t, cl.Close()) diff --git a/api/grpc/limits/service.pb.go b/api/grpc/limits/service.pb.go index 0736524..59d1857 100644 --- a/api/grpc/limits/service.pb.go +++ b/api/grpc/limits/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.3 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/grpc/limits/service.proto package limits @@ -70,7 +70,7 @@ func (x *GetRequest) GetSubj() subject.Subject { if x != nil { return x.Subj } - return subject.Subject_Undefined + return subject.Subject(0) } type GetResponse struct { diff --git a/api/grpc/permits/service.pb.go b/api/grpc/permits/service.pb.go index 8de29e1..a106be7 100644 --- a/api/grpc/permits/service.pb.go +++ b/api/grpc/permits/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.3 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/grpc/permits/service.proto package permits @@ -70,7 +70,7 @@ func (x *GetUsageRequest) GetSubj() subject.Subject { if x != nil { return x.Subj } - return subject.Subject_Undefined + return subject.Subject(0) } type GetUsageResponse struct { diff --git a/api/grpc/reader/service.pb.go b/api/grpc/reader/service.pb.go index 7cc659b..81a89ae 100644 --- a/api/grpc/reader/service.pb.go +++ b/api/grpc/reader/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.3 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/grpc/reader/service.proto package reader diff --git a/api/grpc/resolver/service.pb.go b/api/grpc/resolver/service.pb.go index 202b2d8..b5d8c95 100644 --- a/api/grpc/resolver/service.pb.go +++ b/api/grpc/resolver/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.3 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/grpc/resolver/service.proto package resolver diff --git a/api/grpc/subject/subject.pb.go b/api/grpc/subject/subject.pb.go index e5590c9..2e258a1 100644 --- a/api/grpc/subject/subject.pb.go +++ b/api/grpc/subject/subject.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.3 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/grpc/subject/subject.proto package subject diff --git a/api/grpc/subscriptions/client_mock.go b/api/grpc/subscriptions/client_mock.go index 1aa70ba..1cc691e 100644 --- a/api/grpc/subscriptions/client_mock.go +++ b/api/grpc/subscriptions/client_mock.go @@ -47,6 +47,10 @@ func (cm clientMock) Read(ctx context.Context, req *ReadRequest, opts ...grpc.Ca resp.Description = "subscription" resp.Enabled = true resp.Expires = timestamppb.New(time.Date(2023, 10, 4, 11, 44, 55, 0, time.UTC)) + resp.Created = timestamppb.New(time.Date(2023, 10, 4, 11, 44, 54, 0, time.UTC)) + resp.Updated = timestamppb.New(time.Date(2023, 10, 4, 11, 44, 53, 0, time.UTC)) + resp.Public = true + resp.Followers = 42 resp.Cond = &Condition{ Cond: &Condition_Gc{ Gc: &GroupCondition{ @@ -119,3 +123,19 @@ func (cm clientMock) SearchOwn(ctx context.Context, req *SearchOwnRequest, opts } return } + +func (cm clientMock) Search(ctx context.Context, req *SearchRequest, opts ...grpc.CallOption) (resp *SearchResponse, err error) { + resp = &SearchResponse{} + switch req.Cursor.Id { + case "": + resp.Ids = []string{ + "sub0", + "sub1", + } + case "fail": + err = status.Error(codes.Internal, "internal failure") + case "fail_auth": + err = status.Error(codes.Unauthenticated, "authentication failure") + } + return +} diff --git a/api/grpc/subscriptions/service.go b/api/grpc/subscriptions/service.go index 50f87ea..df80602 100644 --- a/api/grpc/subscriptions/service.go +++ b/api/grpc/subscriptions/service.go @@ -28,8 +28,8 @@ type Service interface { // Returns ErrNotFound if a subscription with the specified id is missing. Delete(ctx context.Context, userId, subId string) (err error) - // SearchOwn returns all subscription ids those have the requested user id. - SearchOwn(ctx context.Context, userId string, limit uint32, cursor string) (ids []string, err error) + // Search returns all subscription ids matching the query. + Search(ctx context.Context, userId string, q subscription.Query, cursor subscription.Cursor) (ids []string, err error) } type service struct { @@ -60,6 +60,7 @@ func (svc service) Create(ctx context.Context, userId string, subData subscripti Description: subData.Description, Enabled: subData.Enabled, Expires: timestamppb.New(subData.Expires.UTC()), + Public: subData.Public, } var resp *CreateResponse resp, err = svc.client.Create(ctx, &req) @@ -85,6 +86,14 @@ func (svc service) Read(ctx context.Context, userId, subId string) (subData subs if resp.Expires != nil { subData.Expires = resp.Expires.AsTime() } + if resp.Created != nil { + subData.Created = resp.Created.AsTime() + } + if resp.Updated != nil { + subData.Created = resp.Updated.AsTime() + } + subData.Public = resp.Public + subData.Followers = resp.Followers } return } @@ -101,6 +110,7 @@ func (svc service) Update(ctx context.Context, userId, subId string, data subscr Enabled: data.Enabled, Expires: timestamppb.New(data.Expires.UTC()), Cond: encodeCondition(data.Condition), + Public: data.Public, } _, err = svc.client.Update(ctx, &req) err = decodeError(err) @@ -118,18 +128,39 @@ func (svc service) Delete(ctx context.Context, userId, subId string) (err error) return } -func (svc service) SearchOwn(ctx context.Context, userId string, limit uint32, cursor string) (ids []string, err error) { +func (svc service) Search(ctx context.Context, userId string, q subscription.Query, cursor subscription.Cursor) (ids []string, err error) { ctx = auth.SetOutgoingAuthInfo(ctx, userId) - req := SearchOwnRequest{ - Cursor: cursor, - Limit: limit, + switch q.Public { + case true: + req := SearchRequest{ + Cursor: &Cursor{ + Followers: cursor.Followers, + Id: cursor.Id, + }, + Limit: q.Limit, + Order: Order(q.Order), + Pattern: q.Pattern, + Sort: Sort(q.Sort), + } + var resp *SearchResponse + resp, err = svc.client.Search(ctx, &req) + if resp != nil { + ids = resp.Ids + } + default: + req := SearchOwnRequest{ + Cursor: cursor.Id, + Limit: q.Limit, + Order: Order(q.Order), + Pattern: q.Pattern, + } + var resp *SearchOwnResponse + resp, err = svc.client.SearchOwn(ctx, &req) + if resp != nil { + ids = resp.Ids + } } - var resp *SearchOwnResponse - resp, err = svc.client.SearchOwn(ctx, &req) err = decodeError(err) - if err == nil { - ids = resp.Ids - } return } diff --git a/api/grpc/subscriptions/service.pb.go b/api/grpc/subscriptions/service.pb.go index 4c120fa..dfd6350 100644 --- a/api/grpc/subscriptions/service.pb.go +++ b/api/grpc/subscriptions/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.3 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/grpc/subscriptions/service.proto package subscriptions @@ -132,6 +132,98 @@ func (Operation) EnumDescriptor() ([]byte, []int) { return file_api_grpc_subscriptions_service_proto_rawDescGZIP(), []int{1} } +type Order int32 + +const ( + Order_ASC Order = 0 + Order_DESC Order = 1 +) + +// Enum value maps for Order. +var ( + Order_name = map[int32]string{ + 0: "ASC", + 1: "DESC", + } + Order_value = map[string]int32{ + "ASC": 0, + "DESC": 1, + } +) + +func (x Order) Enum() *Order { + p := new(Order) + *p = x + return p +} + +func (x Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Order) Descriptor() protoreflect.EnumDescriptor { + return file_api_grpc_subscriptions_service_proto_enumTypes[2].Descriptor() +} + +func (Order) Type() protoreflect.EnumType { + return &file_api_grpc_subscriptions_service_proto_enumTypes[2] +} + +func (x Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Order.Descriptor instead. +func (Order) EnumDescriptor() ([]byte, []int) { + return file_api_grpc_subscriptions_service_proto_rawDescGZIP(), []int{2} +} + +type Sort int32 + +const ( + Sort_ID Sort = 0 + Sort_FOLLOWERS Sort = 1 +) + +// Enum value maps for Sort. +var ( + Sort_name = map[int32]string{ + 0: "ID", + 1: "FOLLOWERS", + } + Sort_value = map[string]int32{ + "ID": 0, + "FOLLOWERS": 1, + } +) + +func (x Sort) Enum() *Sort { + p := new(Sort) + *p = x + return p +} + +func (x Sort) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Sort) Descriptor() protoreflect.EnumDescriptor { + return file_api_grpc_subscriptions_service_proto_enumTypes[3].Descriptor() +} + +func (Sort) Type() protoreflect.EnumType { + return &file_api_grpc_subscriptions_service_proto_enumTypes[3] +} + +func (x Sort) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Sort.Descriptor instead. +func (Sort) EnumDescriptor() ([]byte, []int) { + return file_api_grpc_subscriptions_service_proto_rawDescGZIP(), []int{3} +} + type CreateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -141,6 +233,7 @@ type CreateRequest struct { Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` Cond *Condition `protobuf:"bytes,3,opt,name=cond,proto3" json:"cond,omitempty"` Expires *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires,proto3" json:"expires,omitempty"` + Public bool `protobuf:"varint,5,opt,name=public,proto3" json:"public,omitempty"` } func (x *CreateRequest) Reset() { @@ -203,6 +296,13 @@ func (x *CreateRequest) GetExpires() *timestamppb.Timestamp { return nil } +func (x *CreateRequest) GetPublic() bool { + if x != nil { + return x.Public + } + return false +} + // Condition represents the Subscription routing Condition data that is immutable once Subscription is created. type Condition struct { state protoimpl.MessageState @@ -607,6 +707,10 @@ type ReadResponse struct { Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` Cond *Condition `protobuf:"bytes,3,opt,name=cond,proto3" json:"cond,omitempty"` Expires *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires,proto3" json:"expires,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created,proto3" json:"created,omitempty"` + Updated *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated,proto3" json:"updated,omitempty"` + Public bool `protobuf:"varint,7,opt,name=public,proto3" json:"public,omitempty"` + Followers int64 `protobuf:"varint,8,opt,name=followers,proto3" json:"followers,omitempty"` } func (x *ReadResponse) Reset() { @@ -669,6 +773,34 @@ func (x *ReadResponse) GetExpires() *timestamppb.Timestamp { return nil } +func (x *ReadResponse) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *ReadResponse) GetUpdated() *timestamppb.Timestamp { + if x != nil { + return x.Updated + } + return nil +} + +func (x *ReadResponse) GetPublic() bool { + if x != nil { + return x.Public + } + return false +} + +func (x *ReadResponse) GetFollowers() int64 { + if x != nil { + return x.Followers + } + return 0 +} + type UpdateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -679,6 +811,7 @@ type UpdateRequest struct { Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` Expires *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires,proto3" json:"expires,omitempty"` Cond *Condition `protobuf:"bytes,5,opt,name=cond,proto3" json:"cond,omitempty"` + Public bool `protobuf:"varint,6,opt,name=public,proto3" json:"public,omitempty"` } func (x *UpdateRequest) Reset() { @@ -748,6 +881,13 @@ func (x *UpdateRequest) GetCond() *Condition { return nil } +func (x *UpdateRequest) GetPublic() bool { + if x != nil { + return x.Public + } + return false +} + type UpdateResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -876,8 +1016,10 @@ type SearchOwnRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Cursor string `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"` - Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + Cursor string `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"` + Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + Order Order `protobuf:"varint,3,opt,name=order,proto3,enum=awakari.subscriptions.proxy.Order" json:"order,omitempty"` + Pattern string `protobuf:"bytes,4,opt,name=pattern,proto3" json:"pattern,omitempty"` } func (x *SearchOwnRequest) Reset() { @@ -926,6 +1068,20 @@ func (x *SearchOwnRequest) GetLimit() uint32 { return 0 } +func (x *SearchOwnRequest) GetOrder() Order { + if x != nil { + return x.Order + } + return Order_ASC +} + +func (x *SearchOwnRequest) GetPattern() string { + if x != nil { + return x.Pattern + } + return "" +} + type SearchOwnResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -973,6 +1129,187 @@ func (x *SearchOwnResponse) GetIds() []string { return nil } +type SearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cursor *Cursor `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"` + Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + Order Order `protobuf:"varint,3,opt,name=order,proto3,enum=awakari.subscriptions.proxy.Order" json:"order,omitempty"` + Pattern string `protobuf:"bytes,4,opt,name=Pattern,proto3" json:"Pattern,omitempty"` + Sort Sort `protobuf:"varint,5,opt,name=sort,proto3,enum=awakari.subscriptions.proxy.Sort" json:"sort,omitempty"` +} + +func (x *SearchRequest) Reset() { + *x = SearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_grpc_subscriptions_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRequest) ProtoMessage() {} + +func (x *SearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_grpc_subscriptions_service_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 SearchRequest.ProtoReflect.Descriptor instead. +func (*SearchRequest) Descriptor() ([]byte, []int) { + return file_api_grpc_subscriptions_service_proto_rawDescGZIP(), []int{14} +} + +func (x *SearchRequest) GetCursor() *Cursor { + if x != nil { + return x.Cursor + } + return nil +} + +func (x *SearchRequest) GetLimit() uint32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *SearchRequest) GetOrder() Order { + if x != nil { + return x.Order + } + return Order_ASC +} + +func (x *SearchRequest) GetPattern() string { + if x != nil { + return x.Pattern + } + return "" +} + +func (x *SearchRequest) GetSort() Sort { + if x != nil { + return x.Sort + } + return Sort_ID +} + +type Cursor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Followers int64 `protobuf:"varint,2,opt,name=followers,proto3" json:"followers,omitempty"` +} + +func (x *Cursor) Reset() { + *x = Cursor{} + if protoimpl.UnsafeEnabled { + mi := &file_api_grpc_subscriptions_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cursor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cursor) ProtoMessage() {} + +func (x *Cursor) ProtoReflect() protoreflect.Message { + mi := &file_api_grpc_subscriptions_service_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 Cursor.ProtoReflect.Descriptor instead. +func (*Cursor) Descriptor() ([]byte, []int) { + return file_api_grpc_subscriptions_service_proto_rawDescGZIP(), []int{15} +} + +func (x *Cursor) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Cursor) GetFollowers() int64 { + if x != nil { + return x.Followers + } + return 0 +} + +type SearchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` +} + +func (x *SearchResponse) Reset() { + *x = SearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_grpc_subscriptions_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse) ProtoMessage() {} + +func (x *SearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_grpc_subscriptions_service_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 SearchResponse.ProtoReflect.Descriptor instead. +func (*SearchResponse) Descriptor() ([]byte, []int) { + return file_api_grpc_subscriptions_service_proto_rawDescGZIP(), []int{16} +} + +func (x *SearchResponse) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + var File_api_grpc_subscriptions_service_proto protoreflect.FileDescriptor var file_api_grpc_subscriptions_service_proto_rawDesc = []byte{ @@ -982,7 +1319,7 @@ var file_api_grpc_subscriptions_service_proto_rawDesc = []byte{ 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, @@ -994,125 +1331,174 @@ var file_api_grpc_subscriptions_service_proto_rawDesc = []byte{ 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x65, 0x73, 0x22, 0xe2, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x03, 0x6e, 0x6f, 0x74, 0x12, 0x3d, 0x0a, 0x02, 0x67, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, - 0x02, 0x67, 0x63, 0x12, 0x3c, 0x0a, 0x02, 0x74, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x54, 0x65, - 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x74, - 0x63, 0x12, 0x3e, 0x0a, 0x02, 0x6e, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, - 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x6e, - 0x63, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x8d, 0x01, 0x0a, 0x0e, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x05, - 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x77, - 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, - 0x6f, 0x67, 0x69, 0x63, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x12, 0x3c, 0x0a, 0x05, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x77, 0x61, - 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x5b, 0x0a, 0x0d, 0x54, 0x65, 0x78, - 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x65, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x72, 0x6d, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x22, 0x7d, 0x0a, 0x0f, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x02, 0x6f, - 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, + 0x69, 0x72, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0xe2, 0x01, 0x0a, + 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x6f, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6e, 0x6f, 0x74, 0x12, 0x3d, 0x0a, 0x02, + 0x67, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, + 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x67, 0x63, 0x12, 0x3c, 0x0a, 0x02, 0x74, + 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x02, 0x6f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1d, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xbc, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x74, 0x63, 0x12, 0x3e, 0x0a, 0x02, 0x6e, 0x63, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x02, 0x6e, 0x63, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f, 0x6e, + 0x64, 0x22, 0x8d, 0x01, 0x0a, 0x0e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x52, 0x05, 0x6c, 0x6f, + 0x67, 0x69, 0x63, 0x12, 0x3c, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x22, 0x5b, 0x0a, 0x0d, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x61, 0x63, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x22, 0x7d, + 0x0a, 0x0f, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x26, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x76, + 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x20, 0x0a, + 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x1d, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xde, + 0x02, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x04, 0x63, + 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x77, 0x61, 0x6b, + 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x12, 0x34, 0x0a, + 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x22, + 0xe5, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x34, 0x0a, + 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, - 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x78, - 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, 0xcd, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x63, 0x6f, 0x6e, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, - 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x10, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x25, 0x0a, 0x11, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, - 0x69, 0x64, 0x73, 0x2a, 0x26, 0x0a, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x6f, 0x67, 0x69, - 0x63, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x6e, 0x64, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x72, - 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x6f, 0x72, 0x10, 0x02, 0x2a, 0x44, 0x0a, 0x09, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x74, 0x10, 0x01, 0x12, - 0x07, 0x0a, 0x03, 0x47, 0x74, 0x65, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x71, 0x10, 0x03, - 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x74, 0x65, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x74, 0x10, - 0x05, 0x32, 0xfb, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, - 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, - 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5b, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x28, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, + 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x94, 0x01, 0x0a, + 0x10, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x38, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, + 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, + 0x74, 0x65, 0x72, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, + 0x65, 0x72, 0x6e, 0x22, 0x25, 0x0a, 0x11, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xed, 0x01, 0x0a, 0x0d, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x06, + 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, + 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x75, 0x72, 0x73, 0x6f, + 0x72, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x38, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, + 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x74, + 0x74, 0x65, 0x72, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x50, 0x61, 0x74, 0x74, + 0x65, 0x72, 0x6e, 0x12, 0x35, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x21, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x36, 0x0a, 0x06, 0x43, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x72, 0x73, 0x22, 0x22, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x2a, 0x26, 0x0a, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, + 0x6f, 0x67, 0x69, 0x63, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x6e, 0x64, 0x10, 0x00, 0x12, 0x06, 0x0a, + 0x02, 0x4f, 0x72, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x6f, 0x72, 0x10, 0x02, 0x2a, 0x44, + 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x55, + 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x74, + 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x74, 0x65, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x45, + 0x71, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x74, 0x65, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, + 0x4c, 0x74, 0x10, 0x05, 0x2a, 0x1a, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, + 0x03, 0x41, 0x53, 0x43, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, + 0x2a, 0x1d, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x06, 0x0a, 0x02, 0x49, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x52, 0x53, 0x10, 0x01, 0x32, + 0xde, 0x04, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x06, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, + 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x28, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, + 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x29, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x52, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x06, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, + 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, - 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x6a, 0x0a, 0x09, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x12, 0x2d, + 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, + 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, + 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x2a, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x61, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x61, 0x77, 0x61, - 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, - 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x09, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, - 0x12, 0x2d, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2e, 0x2e, 0x61, 0x77, 0x61, 0x6b, 0x61, 0x72, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x79, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1127,55 +1513,68 @@ func file_api_grpc_subscriptions_service_proto_rawDescGZIP() []byte { return file_api_grpc_subscriptions_service_proto_rawDescData } -var file_api_grpc_subscriptions_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_api_grpc_subscriptions_service_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_api_grpc_subscriptions_service_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_api_grpc_subscriptions_service_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_api_grpc_subscriptions_service_proto_goTypes = []interface{}{ (GroupLogic)(0), // 0: awakari.subscriptions.proxy.GroupLogic (Operation)(0), // 1: awakari.subscriptions.proxy.Operation - (*CreateRequest)(nil), // 2: awakari.subscriptions.proxy.CreateRequest - (*Condition)(nil), // 3: awakari.subscriptions.proxy.Condition - (*GroupCondition)(nil), // 4: awakari.subscriptions.proxy.GroupCondition - (*TextCondition)(nil), // 5: awakari.subscriptions.proxy.TextCondition - (*NumberCondition)(nil), // 6: awakari.subscriptions.proxy.NumberCondition - (*CreateResponse)(nil), // 7: awakari.subscriptions.proxy.CreateResponse - (*ReadRequest)(nil), // 8: awakari.subscriptions.proxy.ReadRequest - (*ReadResponse)(nil), // 9: awakari.subscriptions.proxy.ReadResponse - (*UpdateRequest)(nil), // 10: awakari.subscriptions.proxy.UpdateRequest - (*UpdateResponse)(nil), // 11: awakari.subscriptions.proxy.UpdateResponse - (*DeleteRequest)(nil), // 12: awakari.subscriptions.proxy.DeleteRequest - (*DeleteResponse)(nil), // 13: awakari.subscriptions.proxy.DeleteResponse - (*SearchOwnRequest)(nil), // 14: awakari.subscriptions.proxy.SearchOwnRequest - (*SearchOwnResponse)(nil), // 15: awakari.subscriptions.proxy.SearchOwnResponse - (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp + (Order)(0), // 2: awakari.subscriptions.proxy.Order + (Sort)(0), // 3: awakari.subscriptions.proxy.Sort + (*CreateRequest)(nil), // 4: awakari.subscriptions.proxy.CreateRequest + (*Condition)(nil), // 5: awakari.subscriptions.proxy.Condition + (*GroupCondition)(nil), // 6: awakari.subscriptions.proxy.GroupCondition + (*TextCondition)(nil), // 7: awakari.subscriptions.proxy.TextCondition + (*NumberCondition)(nil), // 8: awakari.subscriptions.proxy.NumberCondition + (*CreateResponse)(nil), // 9: awakari.subscriptions.proxy.CreateResponse + (*ReadRequest)(nil), // 10: awakari.subscriptions.proxy.ReadRequest + (*ReadResponse)(nil), // 11: awakari.subscriptions.proxy.ReadResponse + (*UpdateRequest)(nil), // 12: awakari.subscriptions.proxy.UpdateRequest + (*UpdateResponse)(nil), // 13: awakari.subscriptions.proxy.UpdateResponse + (*DeleteRequest)(nil), // 14: awakari.subscriptions.proxy.DeleteRequest + (*DeleteResponse)(nil), // 15: awakari.subscriptions.proxy.DeleteResponse + (*SearchOwnRequest)(nil), // 16: awakari.subscriptions.proxy.SearchOwnRequest + (*SearchOwnResponse)(nil), // 17: awakari.subscriptions.proxy.SearchOwnResponse + (*SearchRequest)(nil), // 18: awakari.subscriptions.proxy.SearchRequest + (*Cursor)(nil), // 19: awakari.subscriptions.proxy.Cursor + (*SearchResponse)(nil), // 20: awakari.subscriptions.proxy.SearchResponse + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp } var file_api_grpc_subscriptions_service_proto_depIdxs = []int32{ - 3, // 0: awakari.subscriptions.proxy.CreateRequest.cond:type_name -> awakari.subscriptions.proxy.Condition - 16, // 1: awakari.subscriptions.proxy.CreateRequest.expires:type_name -> google.protobuf.Timestamp - 4, // 2: awakari.subscriptions.proxy.Condition.gc:type_name -> awakari.subscriptions.proxy.GroupCondition - 5, // 3: awakari.subscriptions.proxy.Condition.tc:type_name -> awakari.subscriptions.proxy.TextCondition - 6, // 4: awakari.subscriptions.proxy.Condition.nc:type_name -> awakari.subscriptions.proxy.NumberCondition + 5, // 0: awakari.subscriptions.proxy.CreateRequest.cond:type_name -> awakari.subscriptions.proxy.Condition + 21, // 1: awakari.subscriptions.proxy.CreateRequest.expires:type_name -> google.protobuf.Timestamp + 6, // 2: awakari.subscriptions.proxy.Condition.gc:type_name -> awakari.subscriptions.proxy.GroupCondition + 7, // 3: awakari.subscriptions.proxy.Condition.tc:type_name -> awakari.subscriptions.proxy.TextCondition + 8, // 4: awakari.subscriptions.proxy.Condition.nc:type_name -> awakari.subscriptions.proxy.NumberCondition 0, // 5: awakari.subscriptions.proxy.GroupCondition.logic:type_name -> awakari.subscriptions.proxy.GroupLogic - 3, // 6: awakari.subscriptions.proxy.GroupCondition.group:type_name -> awakari.subscriptions.proxy.Condition + 5, // 6: awakari.subscriptions.proxy.GroupCondition.group:type_name -> awakari.subscriptions.proxy.Condition 1, // 7: awakari.subscriptions.proxy.NumberCondition.op:type_name -> awakari.subscriptions.proxy.Operation - 3, // 8: awakari.subscriptions.proxy.ReadResponse.cond:type_name -> awakari.subscriptions.proxy.Condition - 16, // 9: awakari.subscriptions.proxy.ReadResponse.expires:type_name -> google.protobuf.Timestamp - 16, // 10: awakari.subscriptions.proxy.UpdateRequest.expires:type_name -> google.protobuf.Timestamp - 3, // 11: awakari.subscriptions.proxy.UpdateRequest.cond:type_name -> awakari.subscriptions.proxy.Condition - 2, // 12: awakari.subscriptions.proxy.Service.Create:input_type -> awakari.subscriptions.proxy.CreateRequest - 8, // 13: awakari.subscriptions.proxy.Service.Read:input_type -> awakari.subscriptions.proxy.ReadRequest - 10, // 14: awakari.subscriptions.proxy.Service.Update:input_type -> awakari.subscriptions.proxy.UpdateRequest - 12, // 15: awakari.subscriptions.proxy.Service.Delete:input_type -> awakari.subscriptions.proxy.DeleteRequest - 14, // 16: awakari.subscriptions.proxy.Service.SearchOwn:input_type -> awakari.subscriptions.proxy.SearchOwnRequest - 7, // 17: awakari.subscriptions.proxy.Service.Create:output_type -> awakari.subscriptions.proxy.CreateResponse - 9, // 18: awakari.subscriptions.proxy.Service.Read:output_type -> awakari.subscriptions.proxy.ReadResponse - 11, // 19: awakari.subscriptions.proxy.Service.Update:output_type -> awakari.subscriptions.proxy.UpdateResponse - 13, // 20: awakari.subscriptions.proxy.Service.Delete:output_type -> awakari.subscriptions.proxy.DeleteResponse - 15, // 21: awakari.subscriptions.proxy.Service.SearchOwn:output_type -> awakari.subscriptions.proxy.SearchOwnResponse - 17, // [17:22] is the sub-list for method output_type - 12, // [12:17] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 5, // 8: awakari.subscriptions.proxy.ReadResponse.cond:type_name -> awakari.subscriptions.proxy.Condition + 21, // 9: awakari.subscriptions.proxy.ReadResponse.expires:type_name -> google.protobuf.Timestamp + 21, // 10: awakari.subscriptions.proxy.ReadResponse.created:type_name -> google.protobuf.Timestamp + 21, // 11: awakari.subscriptions.proxy.ReadResponse.updated:type_name -> google.protobuf.Timestamp + 21, // 12: awakari.subscriptions.proxy.UpdateRequest.expires:type_name -> google.protobuf.Timestamp + 5, // 13: awakari.subscriptions.proxy.UpdateRequest.cond:type_name -> awakari.subscriptions.proxy.Condition + 2, // 14: awakari.subscriptions.proxy.SearchOwnRequest.order:type_name -> awakari.subscriptions.proxy.Order + 19, // 15: awakari.subscriptions.proxy.SearchRequest.cursor:type_name -> awakari.subscriptions.proxy.Cursor + 2, // 16: awakari.subscriptions.proxy.SearchRequest.order:type_name -> awakari.subscriptions.proxy.Order + 3, // 17: awakari.subscriptions.proxy.SearchRequest.sort:type_name -> awakari.subscriptions.proxy.Sort + 4, // 18: awakari.subscriptions.proxy.Service.Create:input_type -> awakari.subscriptions.proxy.CreateRequest + 10, // 19: awakari.subscriptions.proxy.Service.Read:input_type -> awakari.subscriptions.proxy.ReadRequest + 12, // 20: awakari.subscriptions.proxy.Service.Update:input_type -> awakari.subscriptions.proxy.UpdateRequest + 14, // 21: awakari.subscriptions.proxy.Service.Delete:input_type -> awakari.subscriptions.proxy.DeleteRequest + 16, // 22: awakari.subscriptions.proxy.Service.SearchOwn:input_type -> awakari.subscriptions.proxy.SearchOwnRequest + 18, // 23: awakari.subscriptions.proxy.Service.Search:input_type -> awakari.subscriptions.proxy.SearchRequest + 9, // 24: awakari.subscriptions.proxy.Service.Create:output_type -> awakari.subscriptions.proxy.CreateResponse + 11, // 25: awakari.subscriptions.proxy.Service.Read:output_type -> awakari.subscriptions.proxy.ReadResponse + 13, // 26: awakari.subscriptions.proxy.Service.Update:output_type -> awakari.subscriptions.proxy.UpdateResponse + 15, // 27: awakari.subscriptions.proxy.Service.Delete:output_type -> awakari.subscriptions.proxy.DeleteResponse + 17, // 28: awakari.subscriptions.proxy.Service.SearchOwn:output_type -> awakari.subscriptions.proxy.SearchOwnResponse + 20, // 29: awakari.subscriptions.proxy.Service.Search:output_type -> awakari.subscriptions.proxy.SearchResponse + 24, // [24:30] is the sub-list for method output_type + 18, // [18:24] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_api_grpc_subscriptions_service_proto_init() } @@ -1352,6 +1751,42 @@ func file_api_grpc_subscriptions_service_proto_init() { return nil } } + file_api_grpc_subscriptions_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_grpc_subscriptions_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Cursor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_grpc_subscriptions_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_api_grpc_subscriptions_service_proto_msgTypes[1].OneofWrappers = []interface{}{ (*Condition_Gc)(nil), @@ -1363,8 +1798,8 @@ func file_api_grpc_subscriptions_service_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_grpc_subscriptions_service_proto_rawDesc, - NumEnums: 2, - NumMessages: 14, + NumEnums: 4, + NumMessages: 17, NumExtensions: 0, NumServices: 1, }, @@ -1396,6 +1831,7 @@ type ServiceClient interface { Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) SearchOwn(ctx context.Context, in *SearchOwnRequest, opts ...grpc.CallOption) (*SearchOwnResponse, error) + Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) } type serviceClient struct { @@ -1451,6 +1887,15 @@ func (c *serviceClient) SearchOwn(ctx context.Context, in *SearchOwnRequest, opt return out, nil } +func (c *serviceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { + out := new(SearchResponse) + err := c.cc.Invoke(ctx, "/awakari.subscriptions.proxy.Service/Search", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ServiceServer is the server API for Service service. type ServiceServer interface { Create(context.Context, *CreateRequest) (*CreateResponse, error) @@ -1458,6 +1903,7 @@ type ServiceServer interface { Update(context.Context, *UpdateRequest) (*UpdateResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) SearchOwn(context.Context, *SearchOwnRequest) (*SearchOwnResponse, error) + Search(context.Context, *SearchRequest) (*SearchResponse, error) } // UnimplementedServiceServer can be embedded to have forward compatible implementations. @@ -1479,6 +1925,9 @@ func (*UnimplementedServiceServer) Delete(context.Context, *DeleteRequest) (*Del func (*UnimplementedServiceServer) SearchOwn(context.Context, *SearchOwnRequest) (*SearchOwnResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SearchOwn not implemented") } +func (*UnimplementedServiceServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") +} func RegisterServiceServer(s *grpc.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) @@ -1574,6 +2023,24 @@ func _Service_SearchOwn_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Service_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Search(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/awakari.subscriptions.proxy.Service/Search", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Search(ctx, req.(*SearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Service_serviceDesc = grpc.ServiceDesc{ ServiceName: "awakari.subscriptions.proxy.Service", HandlerType: (*ServiceServer)(nil), @@ -1598,6 +2065,10 @@ var _Service_serviceDesc = grpc.ServiceDesc{ MethodName: "SearchOwn", Handler: _Service_SearchOwn_Handler, }, + { + MethodName: "Search", + Handler: _Service_Search_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/grpc/subscriptions/service.proto", diff --git a/api/grpc/subscriptions/service.proto b/api/grpc/subscriptions/service.proto index ec3f509..06da5f6 100644 --- a/api/grpc/subscriptions/service.proto +++ b/api/grpc/subscriptions/service.proto @@ -8,10 +8,16 @@ import "google/protobuf/timestamp.proto"; service Service { rpc Create(CreateRequest) returns (CreateResponse); + rpc Read(ReadRequest) returns (ReadResponse); + rpc Update(UpdateRequest) returns (UpdateResponse); + rpc Delete(DeleteRequest) returns (DeleteResponse); + rpc SearchOwn(SearchOwnRequest) returns (SearchOwnResponse); + + rpc Search(SearchRequest) returns (SearchResponse); } // Create @@ -21,6 +27,7 @@ message CreateRequest { bool enabled = 2; Condition cond = 3; google.protobuf.Timestamp expires = 4; + bool public = 5; } // Condition represents the Subscription routing Condition data that is immutable once Subscription is created. @@ -82,6 +89,10 @@ message ReadResponse { bool enabled = 2; Condition cond = 3; google.protobuf.Timestamp expires = 4; + google.protobuf.Timestamp created = 5; + google.protobuf.Timestamp updated = 6; + bool public = 7; + int64 followers = 8; } // Update @@ -92,6 +103,7 @@ message UpdateRequest { bool enabled = 3; google.protobuf.Timestamp expires = 4; Condition cond = 5; + bool public = 6; } message UpdateResponse { @@ -111,8 +123,41 @@ message DeleteResponse { message SearchOwnRequest { string cursor = 1; uint32 limit = 2; + Order order = 3; + string pattern = 4; +} + +enum Order { + ASC = 0; + DESC = 1; } message SearchOwnResponse { repeated string ids = 1; } + +// Search (including public interests) + +// Search + +message SearchRequest { + Cursor cursor = 1; + uint32 limit = 2; + Order order = 3; + string Pattern = 4; + Sort sort = 5; +} + +message Cursor { + string id = 1; + int64 followers = 2; +} + +enum Sort { + ID = 0; + FOLLOWERS = 1; +} + +message SearchResponse { + repeated string ids = 1; +} diff --git a/api/grpc/subscriptions/service_mock.go b/api/grpc/subscriptions/service_mock.go index 4aeb1b1..e53619a 100644 --- a/api/grpc/subscriptions/service_mock.go +++ b/api/grpc/subscriptions/service_mock.go @@ -86,8 +86,8 @@ func (sm serviceMock) Delete(ctx context.Context, userId, subId string) (err err return } -func (sm serviceMock) SearchOwn(ctx context.Context, userId string, limit uint32, cursor string) (ids []string, err error) { - switch cursor { +func (sm serviceMock) Search(ctx context.Context, userId string, q subscription.Query, cursor subscription.Cursor) (ids []string, err error) { + switch cursor.Id { case "": ids = []string{ "sub0", diff --git a/api/grpc/subscriptions/service_test.go b/api/grpc/subscriptions/service_test.go index 444ed68..a1d2785 100644 --- a/api/grpc/subscriptions/service_test.go +++ b/api/grpc/subscriptions/service_test.go @@ -326,7 +326,7 @@ func TestService_Delete(t *testing.T) { } } -func TestService_SearchOwn(t *testing.T) { +func TestService_Search(t *testing.T) { // svc := NewService(newClientMock()) // @@ -355,7 +355,9 @@ func TestService_SearchOwn(t *testing.T) { t.Run(name, func(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) defer cancel() - ids, err := svc.SearchOwn(ctx, "user0", 0, c.cursor) + ids, err := svc.Search(ctx, "user0", subscription.Query{}, subscription.Cursor{ + Id: c.cursor, + }) assert.Equal(t, ids, c.ids) assert.ErrorIs(t, err, c.err) }) diff --git a/go.mod b/go.mod index ac47e77..06a2de7 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,24 @@ module github.com/awakari/client-sdk-go -go 1.21 +go 1.22 require ( - github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.14.0 - github.com/google/uuid v1.3.0 - github.com/stretchr/testify v1.8.0 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.15.2 + github.com/google/uuid v1.6.0 + github.com/stretchr/testify v1.9.0 + google.golang.org/grpc v1.64.0 + google.golang.org/protobuf v1.34.2 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect - google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7f2be6c..f0a5843 100644 --- a/go.sum +++ b/go.sum @@ -1,39 +1,41 @@ -github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.14.0 h1:dEopBSOSjB5fM9r76ufM44AVj9Dnz2IOM0Xs6FVxZRM= -github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.14.0/go.mod h1:qDSbb0fgIfFNjZrNTPtS5MOMScAGyQtn1KlSvoOdqYw= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.15.2 h1:FIvfKlS2mcuP0qYY6yzdIU9xdrRd/YMP0bNwFjXd0u8= +github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.15.2/go.mod h1:POsdVp/08Mki0WD9QvvgRRpg9CQ6zhjfRrBoEY8JFS8= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d h1:k3zyW3BYYR30e8v3x0bTDdE9vpYFjZHK+HcyqkrppWk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/model/subscription/cursor.go b/model/subscription/cursor.go new file mode 100644 index 0000000..e8dce4d --- /dev/null +++ b/model/subscription/cursor.go @@ -0,0 +1,6 @@ +package subscription + +type Cursor struct { + Id string + Followers int64 +} diff --git a/model/subscription/data.go b/model/subscription/data.go index f1add6e..3ae9868 100644 --- a/model/subscription/data.go +++ b/model/subscription/data.go @@ -19,4 +19,12 @@ type Data struct { // Expires defines a deadline when subscription becomes disabled regardless the Enabled value. Expires time.Time + + Created time.Time + + Updated time.Time + + Public bool + + Followers int64 } diff --git a/model/subscription/query.go b/model/subscription/query.go new file mode 100644 index 0000000..df1b455 --- /dev/null +++ b/model/subscription/query.go @@ -0,0 +1,42 @@ +package subscription + +type Query struct { + Limit uint32 + Sort Sort + Order Order + Pattern string + Public bool // include public non-own? +} + +type QueryByCondition struct { + CondId string + Limit uint32 +} + +type Sort int + +const ( + SortId Sort = iota + SortFollowers +) + +func (s Sort) String() string { + return [...]string{ + "Id", + "Followers", + }[s] +} + +type Order int + +const ( + OrderAsc Order = iota + OrderDesc +) + +func (o Order) String() string { + return [...]string{ + "Asc", + "Desc", + }[o] +}