Initial QSfera import
This commit is contained in:
@@ -0,0 +1,206 @@
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qsfera/server/protogen/gen/qsfera/services/search/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// NewSearchProviderService creates a new instance of SearchProviderService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSearchProviderService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *SearchProviderService {
|
||||
mock := &SearchProviderService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// SearchProviderService is an autogenerated mock type for the SearchProviderService type
|
||||
type SearchProviderService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type SearchProviderService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *SearchProviderService) EXPECT() *SearchProviderService_Expecter {
|
||||
return &SearchProviderService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// IndexSpace provides a mock function for the type SearchProviderService
|
||||
func (_mock *SearchProviderService) IndexSpace(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IndexSpace")
|
||||
}
|
||||
|
||||
var r0 *v0.IndexSpaceResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) *v0.IndexSpaceResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.IndexSpaceResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchProviderService_IndexSpace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexSpace'
|
||||
type SearchProviderService_IndexSpace_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// IndexSpace is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.IndexSpaceRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *SearchProviderService_Expecter) IndexSpace(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_IndexSpace_Call {
|
||||
return &SearchProviderService_IndexSpace_Call{Call: _e.mock.On("IndexSpace",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) Run(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption)) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *v0.IndexSpaceRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.IndexSpaceRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) Return(indexSpaceResponse *v0.IndexSpaceResponse, err error) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Return(indexSpaceResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) RunAndReturn(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error)) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Search provides a mock function for the type SearchProviderService
|
||||
func (_mock *SearchProviderService) Search(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
}
|
||||
|
||||
var r0 *v0.SearchResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) *v0.SearchResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SearchResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchProviderService_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search'
|
||||
type SearchProviderService_Search_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Search is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.SearchRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *SearchProviderService_Expecter) Search(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_Search_Call {
|
||||
return &SearchProviderService_Search_Call{Call: _e.mock.On("Search",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) Run(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption)) *SearchProviderService_Search_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *v0.SearchRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.SearchRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) Return(searchResponse *v0.SearchResponse, err error) *SearchProviderService_Search_Call {
|
||||
_c.Call.Return(searchResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) RunAndReturn(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error)) *SearchProviderService_Search_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
@@ -0,0 +1,670 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc (unknown)
|
||||
// source: qsfera/services/search/v0/search.proto
|
||||
|
||||
package v0
|
||||
|
||||
import (
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
v0 "github.com/qsfera/server/protogen/gen/qsfera/messages/search/v0"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
_ "google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||
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 SearchRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Optional. The maximum number of entries to return in the response
|
||||
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
||||
// Optional. A pagination token returned from a previous call to `Get`
|
||||
// that indicates from where search should continue
|
||||
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
|
||||
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
|
||||
Ref *v0.Reference `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SearchRequest) Reset() {
|
||||
*x = SearchRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[0]
|
||||
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_qsfera_services_search_v0_search_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 SearchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SearchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SearchRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SearchRequest) GetPageToken() string {
|
||||
if x != nil {
|
||||
return x.PageToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SearchRequest) GetQuery() string {
|
||||
if x != nil {
|
||||
return x.Query
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SearchRequest) GetRef() *v0.Reference {
|
||||
if x != nil {
|
||||
return x.Ref
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SearchResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Matches []*v0.Match `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
|
||||
// Token to retrieve the next page of results, or empty if there are no
|
||||
// more results in the list
|
||||
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
|
||||
TotalMatches int32 `protobuf:"varint,3,opt,name=total_matches,json=totalMatches,proto3" json:"total_matches,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SearchResponse) Reset() {
|
||||
*x = SearchResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[1]
|
||||
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_qsfera_services_search_v0_search_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 SearchResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SearchResponse) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SearchResponse) GetMatches() []*v0.Match {
|
||||
if x != nil {
|
||||
return x.Matches
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SearchResponse) GetNextPageToken() string {
|
||||
if x != nil {
|
||||
return x.NextPageToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SearchResponse) GetTotalMatches() int32 {
|
||||
if x != nil {
|
||||
return x.TotalMatches
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SearchIndexRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Optional. The maximum number of entries to return in the response
|
||||
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
||||
// Optional. A pagination token returned from a previous call to `Get`
|
||||
// that indicates from where search should continue
|
||||
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
|
||||
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
|
||||
Ref *v0.Reference `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SearchIndexRequest) Reset() {
|
||||
*x = SearchIndexRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SearchIndexRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SearchIndexRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SearchIndexRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_qsfera_services_search_v0_search_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 SearchIndexRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SearchIndexRequest) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SearchIndexRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SearchIndexRequest) GetPageToken() string {
|
||||
if x != nil {
|
||||
return x.PageToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SearchIndexRequest) GetQuery() string {
|
||||
if x != nil {
|
||||
return x.Query
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SearchIndexRequest) GetRef() *v0.Reference {
|
||||
if x != nil {
|
||||
return x.Ref
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SearchIndexResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Matches []*v0.Match `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
|
||||
// Token to retrieve the next page of results, or empty if there are no
|
||||
// more results in the list
|
||||
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
|
||||
TotalMatches int32 `protobuf:"varint,3,opt,name=total_matches,json=totalMatches,proto3" json:"total_matches,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SearchIndexResponse) Reset() {
|
||||
*x = SearchIndexResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SearchIndexResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SearchIndexResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SearchIndexResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_qsfera_services_search_v0_search_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 SearchIndexResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SearchIndexResponse) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *SearchIndexResponse) GetMatches() []*v0.Match {
|
||||
if x != nil {
|
||||
return x.Matches
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SearchIndexResponse) GetNextPageToken() string {
|
||||
if x != nil {
|
||||
return x.NextPageToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SearchIndexResponse) GetTotalMatches() int32 {
|
||||
if x != nil {
|
||||
return x.TotalMatches
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type IndexSpaceRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"`
|
||||
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
ForceReindex bool `protobuf:"varint,3,opt,name=force_reindex,json=forceReindex,proto3" json:"force_reindex,omitempty"`
|
||||
}
|
||||
|
||||
func (x *IndexSpaceRequest) Reset() {
|
||||
*x = IndexSpaceRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *IndexSpaceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IndexSpaceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *IndexSpaceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_qsfera_services_search_v0_search_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 IndexSpaceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*IndexSpaceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *IndexSpaceRequest) GetSpaceId() string {
|
||||
if x != nil {
|
||||
return x.SpaceId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IndexSpaceRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IndexSpaceRequest) GetForceReindex() bool {
|
||||
if x != nil {
|
||||
return x.ForceReindex
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type IndexSpaceResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *IndexSpaceResponse) Reset() {
|
||||
*x = IndexSpaceResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_search_v0_search_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *IndexSpaceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IndexSpaceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *IndexSpaceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_qsfera_services_search_v0_search_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 IndexSpaceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*IndexSpaceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_search_v0_search_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
var File_qsfera_services_search_v0_search_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_qsfera_services_search_v0_search_proto_rawDesc = []byte{
|
||||
0x0a, 0x29, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30, 0x2f, 0x73,
|
||||
0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x6f, 0x70, 0x65,
|
||||
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,
|
||||
0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x1a, 0x29, 0x6f, 0x70, 0x65, 0x6e, 0x63,
|
||||
0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x73, 0x65,
|
||||
0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 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, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f,
|
||||
0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01,
|
||||
0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x70, 0x61,
|
||||
0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04,
|
||||
0xe2, 0x41, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||
0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76,
|
||||
0x30, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01,
|
||||
0x01, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0x9c, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63,
|
||||
0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x6d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65,
|
||||
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e,
|
||||
0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52,
|
||||
0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74,
|
||||
0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
|
||||
0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61,
|
||||
0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
|
||||
0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09,
|
||||
0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42,
|
||||
0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
|
||||
0x23, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x03, 0x72, 0x65,
|
||||
0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
|
||||
0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61,
|
||||
0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
|
||||
0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0xa1, 0x01, 0x0a, 0x13,
|
||||
0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68,
|
||||
0x2e, 0x76, 0x30, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68,
|
||||
0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f,
|
||||
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78,
|
||||
0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f,
|
||||
0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22,
|
||||
0x6c, 0x0a, 0x11, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12,
|
||||
0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x6f, 0x72, 0x63,
|
||||
0x65, 0x5f, 0x72, 0x65, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x14, 0x0a,
|
||||
0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x32, 0xb1, 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72,
|
||||
0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63,
|
||||
0x68, 0x12, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30,
|
||||
0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c,
|
||||
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65,
|
||||
0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3,
|
||||
0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30,
|
||||
0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x96,
|
||||
0x01, 0x0a, 0x0a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2f, 0x2e,
|
||||
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e, 0x64,
|
||||
0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30,
|
||||
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e,
|
||||
0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x64, 0x65,
|
||||
0x78, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x32, 0xa7, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x65,
|
||||
0x78, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x95, 0x01, 0x0a, 0x06, 0x53, 0x65,
|
||||
0x61, 0x72, 0x63, 0x68, 0x12, 0x30, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68,
|
||||
0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
|
||||
0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72,
|
||||
0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65,
|
||||
0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02,
|
||||
0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65,
|
||||
0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63,
|
||||
0x68, 0x42, 0xf2, 0x02, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70,
|
||||
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e,
|
||||
0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30,
|
||||
0x92, 0x41, 0xa2, 0x02, 0x12, 0xb7, 0x01, 0x0a, 0x10, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f,
|
||||
0x75, 0x64, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x22, 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65,
|
||||
0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x12, 0x29, 0x68, 0x74, 0x74,
|
||||
0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65,
|
||||
0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40,
|
||||
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75, 0x2a, 0x49, 0x0a, 0x0a,
|
||||
0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x3b, 0x68, 0x74, 0x74, 0x70,
|
||||
0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f,
|
||||
0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e,
|
||||
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 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, 0x3e, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f,
|
||||
0x70, 0x65, 0x72, 0x20, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x12, 0x2a, 0x68, 0x74, 0x74, 0x70,
|
||||
0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
|
||||
0x75, 0x64, 0x2e, 0x65, 0x75, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73,
|
||||
0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_qsfera_services_search_v0_search_proto_rawDescOnce sync.Once
|
||||
file_qsfera_services_search_v0_search_proto_rawDescData = file_qsfera_services_search_v0_search_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_qsfera_services_search_v0_search_proto_rawDescGZIP() []byte {
|
||||
file_qsfera_services_search_v0_search_proto_rawDescOnce.Do(func() {
|
||||
file_qsfera_services_search_v0_search_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_services_search_v0_search_proto_rawDescData)
|
||||
})
|
||||
return file_qsfera_services_search_v0_search_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_qsfera_services_search_v0_search_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_qsfera_services_search_v0_search_proto_goTypes = []interface{}{
|
||||
(*SearchRequest)(nil), // 0: qsfera.services.search.v0.SearchRequest
|
||||
(*SearchResponse)(nil), // 1: qsfera.services.search.v0.SearchResponse
|
||||
(*SearchIndexRequest)(nil), // 2: qsfera.services.search.v0.SearchIndexRequest
|
||||
(*SearchIndexResponse)(nil), // 3: qsfera.services.search.v0.SearchIndexResponse
|
||||
(*IndexSpaceRequest)(nil), // 4: qsfera.services.search.v0.IndexSpaceRequest
|
||||
(*IndexSpaceResponse)(nil), // 5: qsfera.services.search.v0.IndexSpaceResponse
|
||||
(*v0.Reference)(nil), // 6: qsfera.messages.search.v0.Reference
|
||||
(*v0.Match)(nil), // 7: qsfera.messages.search.v0.Match
|
||||
}
|
||||
var file_qsfera_services_search_v0_search_proto_depIdxs = []int32{
|
||||
6, // 0: qsfera.services.search.v0.SearchRequest.ref:type_name -> qsfera.messages.search.v0.Reference
|
||||
7, // 1: qsfera.services.search.v0.SearchResponse.matches:type_name -> qsfera.messages.search.v0.Match
|
||||
6, // 2: qsfera.services.search.v0.SearchIndexRequest.ref:type_name -> qsfera.messages.search.v0.Reference
|
||||
7, // 3: qsfera.services.search.v0.SearchIndexResponse.matches:type_name -> qsfera.messages.search.v0.Match
|
||||
0, // 4: qsfera.services.search.v0.SearchProvider.Search:input_type -> qsfera.services.search.v0.SearchRequest
|
||||
4, // 5: qsfera.services.search.v0.SearchProvider.IndexSpace:input_type -> qsfera.services.search.v0.IndexSpaceRequest
|
||||
2, // 6: qsfera.services.search.v0.IndexProvider.Search:input_type -> qsfera.services.search.v0.SearchIndexRequest
|
||||
1, // 7: qsfera.services.search.v0.SearchProvider.Search:output_type -> qsfera.services.search.v0.SearchResponse
|
||||
5, // 8: qsfera.services.search.v0.SearchProvider.IndexSpace:output_type -> qsfera.services.search.v0.IndexSpaceResponse
|
||||
3, // 9: qsfera.services.search.v0.IndexProvider.Search:output_type -> qsfera.services.search.v0.SearchIndexResponse
|
||||
7, // [7:10] is the sub-list for method output_type
|
||||
4, // [4:7] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_qsfera_services_search_v0_search_proto_init() }
|
||||
func file_qsfera_services_search_v0_search_proto_init() {
|
||||
if File_qsfera_services_search_v0_search_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_qsfera_services_search_v0_search_proto_msgTypes[0].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_qsfera_services_search_v0_search_proto_msgTypes[1].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_qsfera_services_search_v0_search_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SearchIndexRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_qsfera_services_search_v0_search_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SearchIndexResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_qsfera_services_search_v0_search_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IndexSpaceRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_qsfera_services_search_v0_search_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IndexSpaceResponse); 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_qsfera_services_search_v0_search_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 2,
|
||||
},
|
||||
GoTypes: file_qsfera_services_search_v0_search_proto_goTypes,
|
||||
DependencyIndexes: file_qsfera_services_search_v0_search_proto_depIdxs,
|
||||
MessageInfos: file_qsfera_services_search_v0_search_proto_msgTypes,
|
||||
}.Build()
|
||||
File_qsfera_services_search_v0_search_proto = out.File
|
||||
file_qsfera_services_search_v0_search_proto_rawDesc = nil
|
||||
file_qsfera_services_search_v0_search_proto_goTypes = nil
|
||||
file_qsfera_services_search_v0_search_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: qsfera/services/search/v0/search.proto
|
||||
|
||||
package v0
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
_ "github.com/qsfera/server/protogen/gen/qsfera/messages/search/v0"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
_ "google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||
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 SearchProvider service
|
||||
|
||||
func NewSearchProviderEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
{
|
||||
Name: "SearchProvider.Search",
|
||||
Path: []string{"/api/v0/search/search"},
|
||||
Method: []string{"POST"},
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "SearchProvider.IndexSpace",
|
||||
Path: []string{"/api/v0/search/index-space"},
|
||||
Method: []string{"POST"},
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for SearchProvider service
|
||||
|
||||
type SearchProviderService interface {
|
||||
Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error)
|
||||
IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...client.CallOption) (*IndexSpaceResponse, error)
|
||||
}
|
||||
|
||||
type searchProviderService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewSearchProviderService(name string, c client.Client) SearchProviderService {
|
||||
return &searchProviderService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *searchProviderService) Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "SearchProvider.Search", in)
|
||||
out := new(SearchResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *searchProviderService) IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...client.CallOption) (*IndexSpaceResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "SearchProvider.IndexSpace", in)
|
||||
out := new(IndexSpaceResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for SearchProvider service
|
||||
|
||||
type SearchProviderHandler interface {
|
||||
Search(context.Context, *SearchRequest, *SearchResponse) error
|
||||
IndexSpace(context.Context, *IndexSpaceRequest, *IndexSpaceResponse) error
|
||||
}
|
||||
|
||||
func RegisterSearchProviderHandler(s server.Server, hdlr SearchProviderHandler, opts ...server.HandlerOption) error {
|
||||
type searchProvider interface {
|
||||
Search(ctx context.Context, in *SearchRequest, out *SearchResponse) error
|
||||
IndexSpace(ctx context.Context, in *IndexSpaceRequest, out *IndexSpaceResponse) error
|
||||
}
|
||||
type SearchProvider struct {
|
||||
searchProvider
|
||||
}
|
||||
h := &searchProviderHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "SearchProvider.Search",
|
||||
Path: []string{"/api/v0/search/search"},
|
||||
Method: []string{"POST"},
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "SearchProvider.IndexSpace",
|
||||
Path: []string{"/api/v0/search/index-space"},
|
||||
Method: []string{"POST"},
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&SearchProvider{h}, opts...))
|
||||
}
|
||||
|
||||
type searchProviderHandler struct {
|
||||
SearchProviderHandler
|
||||
}
|
||||
|
||||
func (h *searchProviderHandler) Search(ctx context.Context, in *SearchRequest, out *SearchResponse) error {
|
||||
return h.SearchProviderHandler.Search(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *searchProviderHandler) IndexSpace(ctx context.Context, in *IndexSpaceRequest, out *IndexSpaceResponse) error {
|
||||
return h.SearchProviderHandler.IndexSpace(ctx, in, out)
|
||||
}
|
||||
|
||||
// Api Endpoints for IndexProvider service
|
||||
|
||||
func NewIndexProviderEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
{
|
||||
Name: "IndexProvider.Search",
|
||||
Path: []string{"/api/v0/search/index/search"},
|
||||
Method: []string{"POST"},
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for IndexProvider service
|
||||
|
||||
type IndexProviderService interface {
|
||||
Search(ctx context.Context, in *SearchIndexRequest, opts ...client.CallOption) (*SearchIndexResponse, error)
|
||||
}
|
||||
|
||||
type indexProviderService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewIndexProviderService(name string, c client.Client) IndexProviderService {
|
||||
return &indexProviderService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *indexProviderService) Search(ctx context.Context, in *SearchIndexRequest, opts ...client.CallOption) (*SearchIndexResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "IndexProvider.Search", in)
|
||||
out := new(SearchIndexResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for IndexProvider service
|
||||
|
||||
type IndexProviderHandler interface {
|
||||
Search(context.Context, *SearchIndexRequest, *SearchIndexResponse) error
|
||||
}
|
||||
|
||||
func RegisterIndexProviderHandler(s server.Server, hdlr IndexProviderHandler, opts ...server.HandlerOption) error {
|
||||
type indexProvider interface {
|
||||
Search(ctx context.Context, in *SearchIndexRequest, out *SearchIndexResponse) error
|
||||
}
|
||||
type IndexProvider struct {
|
||||
indexProvider
|
||||
}
|
||||
h := &indexProviderHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "IndexProvider.Search",
|
||||
Path: []string{"/api/v0/search/index/search"},
|
||||
Method: []string{"POST"},
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&IndexProvider{h}, opts...))
|
||||
}
|
||||
|
||||
type indexProviderHandler struct {
|
||||
IndexProviderHandler
|
||||
}
|
||||
|
||||
func (h *indexProviderHandler) Search(ctx context.Context, in *SearchIndexRequest, out *SearchIndexResponse) error {
|
||||
return h.IndexProviderHandler.Search(ctx, in, out)
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
// Code generated by protoc-gen-microweb. DO NOT EDIT.
|
||||
// source: v0.proto
|
||||
|
||||
package v0
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/render"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
merrors "go-micro.dev/v4/errors"
|
||||
)
|
||||
|
||||
type webSearchProviderHandler struct {
|
||||
r chi.Router
|
||||
h SearchProviderHandler
|
||||
}
|
||||
|
||||
func (h *webSearchProviderHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
h.r.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
func (h *webSearchProviderHandler) Search(w http.ResponseWriter, r *http.Request) {
|
||||
req := &SearchRequest{}
|
||||
resp := &SearchResponse{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusPreconditionFailed)
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.h.Search(
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound {
|
||||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
} else {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, resp)
|
||||
}
|
||||
|
||||
func (h *webSearchProviderHandler) IndexSpace(w http.ResponseWriter, r *http.Request) {
|
||||
req := &IndexSpaceRequest{}
|
||||
resp := &IndexSpaceResponse{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusPreconditionFailed)
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.h.IndexSpace(
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound {
|
||||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
} else {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, resp)
|
||||
}
|
||||
|
||||
func RegisterSearchProviderWeb(r chi.Router, i SearchProviderHandler, middlewares ...func(http.Handler) http.Handler) {
|
||||
handler := &webSearchProviderHandler{
|
||||
r: r,
|
||||
h: i,
|
||||
}
|
||||
|
||||
r.MethodFunc("POST", "/api/v0/search/search", handler.Search)
|
||||
r.MethodFunc("POST", "/api/v0/search/index-space", handler.IndexSpace)
|
||||
}
|
||||
|
||||
type webIndexProviderHandler struct {
|
||||
r chi.Router
|
||||
h IndexProviderHandler
|
||||
}
|
||||
|
||||
func (h *webIndexProviderHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
h.r.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
func (h *webIndexProviderHandler) Search(w http.ResponseWriter, r *http.Request) {
|
||||
req := &SearchIndexRequest{}
|
||||
resp := &SearchIndexResponse{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusPreconditionFailed)
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.h.Search(
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound {
|
||||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
} else {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, resp)
|
||||
}
|
||||
|
||||
func RegisterIndexProviderWeb(r chi.Router, i IndexProviderHandler, middlewares ...func(http.Handler) http.Handler) {
|
||||
handler := &webIndexProviderHandler{
|
||||
r: r,
|
||||
h: i,
|
||||
}
|
||||
|
||||
r.MethodFunc("POST", "/api/v0/search/index/search", handler.Search)
|
||||
}
|
||||
|
||||
// SearchRequestJSONMarshaler describes the default jsonpb.Marshaler used by all
|
||||
// instances of SearchRequest. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchRequestJSONMarshaler = new(jsonpb.Marshaler)
|
||||
|
||||
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly marshal the message.
|
||||
func (m *SearchRequest) MarshalJSON() ([]byte, error) {
|
||||
if m == nil {
|
||||
return json.Marshal(nil)
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
if err := SearchRequestJSONMarshaler.Marshal(buf, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var _ json.Marshaler = (*SearchRequest)(nil)
|
||||
|
||||
// SearchRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
|
||||
// instances of SearchRequest. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchRequestJSONUnmarshaler = new(jsonpb.Unmarshaler)
|
||||
|
||||
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly unmarshal the message.
|
||||
func (m *SearchRequest) UnmarshalJSON(b []byte) error {
|
||||
return SearchRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
|
||||
}
|
||||
|
||||
var _ json.Unmarshaler = (*SearchRequest)(nil)
|
||||
|
||||
// SearchResponseJSONMarshaler describes the default jsonpb.Marshaler used by all
|
||||
// instances of SearchResponse. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchResponseJSONMarshaler = new(jsonpb.Marshaler)
|
||||
|
||||
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly marshal the message.
|
||||
func (m *SearchResponse) MarshalJSON() ([]byte, error) {
|
||||
if m == nil {
|
||||
return json.Marshal(nil)
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
if err := SearchResponseJSONMarshaler.Marshal(buf, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var _ json.Marshaler = (*SearchResponse)(nil)
|
||||
|
||||
// SearchResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
|
||||
// instances of SearchResponse. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchResponseJSONUnmarshaler = new(jsonpb.Unmarshaler)
|
||||
|
||||
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly unmarshal the message.
|
||||
func (m *SearchResponse) UnmarshalJSON(b []byte) error {
|
||||
return SearchResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
|
||||
}
|
||||
|
||||
var _ json.Unmarshaler = (*SearchResponse)(nil)
|
||||
|
||||
// SearchIndexRequestJSONMarshaler describes the default jsonpb.Marshaler used by all
|
||||
// instances of SearchIndexRequest. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchIndexRequestJSONMarshaler = new(jsonpb.Marshaler)
|
||||
|
||||
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly marshal the message.
|
||||
func (m *SearchIndexRequest) MarshalJSON() ([]byte, error) {
|
||||
if m == nil {
|
||||
return json.Marshal(nil)
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
if err := SearchIndexRequestJSONMarshaler.Marshal(buf, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var _ json.Marshaler = (*SearchIndexRequest)(nil)
|
||||
|
||||
// SearchIndexRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
|
||||
// instances of SearchIndexRequest. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchIndexRequestJSONUnmarshaler = new(jsonpb.Unmarshaler)
|
||||
|
||||
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly unmarshal the message.
|
||||
func (m *SearchIndexRequest) UnmarshalJSON(b []byte) error {
|
||||
return SearchIndexRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
|
||||
}
|
||||
|
||||
var _ json.Unmarshaler = (*SearchIndexRequest)(nil)
|
||||
|
||||
// SearchIndexResponseJSONMarshaler describes the default jsonpb.Marshaler used by all
|
||||
// instances of SearchIndexResponse. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchIndexResponseJSONMarshaler = new(jsonpb.Marshaler)
|
||||
|
||||
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly marshal the message.
|
||||
func (m *SearchIndexResponse) MarshalJSON() ([]byte, error) {
|
||||
if m == nil {
|
||||
return json.Marshal(nil)
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
if err := SearchIndexResponseJSONMarshaler.Marshal(buf, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var _ json.Marshaler = (*SearchIndexResponse)(nil)
|
||||
|
||||
// SearchIndexResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
|
||||
// instances of SearchIndexResponse. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var SearchIndexResponseJSONUnmarshaler = new(jsonpb.Unmarshaler)
|
||||
|
||||
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly unmarshal the message.
|
||||
func (m *SearchIndexResponse) UnmarshalJSON(b []byte) error {
|
||||
return SearchIndexResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
|
||||
}
|
||||
|
||||
var _ json.Unmarshaler = (*SearchIndexResponse)(nil)
|
||||
|
||||
// IndexSpaceRequestJSONMarshaler describes the default jsonpb.Marshaler used by all
|
||||
// instances of IndexSpaceRequest. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var IndexSpaceRequestJSONMarshaler = new(jsonpb.Marshaler)
|
||||
|
||||
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly marshal the message.
|
||||
func (m *IndexSpaceRequest) MarshalJSON() ([]byte, error) {
|
||||
if m == nil {
|
||||
return json.Marshal(nil)
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
if err := IndexSpaceRequestJSONMarshaler.Marshal(buf, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var _ json.Marshaler = (*IndexSpaceRequest)(nil)
|
||||
|
||||
// IndexSpaceRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
|
||||
// instances of IndexSpaceRequest. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var IndexSpaceRequestJSONUnmarshaler = new(jsonpb.Unmarshaler)
|
||||
|
||||
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly unmarshal the message.
|
||||
func (m *IndexSpaceRequest) UnmarshalJSON(b []byte) error {
|
||||
return IndexSpaceRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
|
||||
}
|
||||
|
||||
var _ json.Unmarshaler = (*IndexSpaceRequest)(nil)
|
||||
|
||||
// IndexSpaceResponseJSONMarshaler describes the default jsonpb.Marshaler used by all
|
||||
// instances of IndexSpaceResponse. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var IndexSpaceResponseJSONMarshaler = new(jsonpb.Marshaler)
|
||||
|
||||
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly marshal the message.
|
||||
func (m *IndexSpaceResponse) MarshalJSON() ([]byte, error) {
|
||||
if m == nil {
|
||||
return json.Marshal(nil)
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
if err := IndexSpaceResponseJSONMarshaler.Marshal(buf, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var _ json.Marshaler = (*IndexSpaceResponse)(nil)
|
||||
|
||||
// IndexSpaceResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
|
||||
// instances of IndexSpaceResponse. This struct is safe to replace or modify but
|
||||
// should not be done so concurrently.
|
||||
var IndexSpaceResponseJSONUnmarshaler = new(jsonpb.Unmarshaler)
|
||||
|
||||
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
|
||||
// uses the more correct jsonpb package to correctly unmarshal the message.
|
||||
func (m *IndexSpaceResponse) UnmarshalJSON(b []byte) error {
|
||||
return IndexSpaceResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
|
||||
}
|
||||
|
||||
var _ json.Unmarshaler = (*IndexSpaceResponse)(nil)
|
||||
@@ -0,0 +1,502 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "КуСфера search",
|
||||
"version": "1.0.0",
|
||||
"contact": {
|
||||
"name": "КуСфера",
|
||||
"url": "",
|
||||
"email": ""
|
||||
},
|
||||
"license": {
|
||||
"name": "Apache-2.0",
|
||||
"url": ""
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "SearchProvider"
|
||||
},
|
||||
{
|
||||
"name": "IndexProvider"
|
||||
}
|
||||
],
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {
|
||||
"/api/v0/search/index-space": {
|
||||
"post": {
|
||||
"operationId": "SearchProvider_IndexSpace",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v0IndexSpaceResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v0IndexSpaceRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"SearchProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v0/search/index/search": {
|
||||
"post": {
|
||||
"operationId": "IndexProvider_Search",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v0SearchIndexResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v0SearchIndexRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"IndexProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v0/search/search": {
|
||||
"post": {
|
||||
"operationId": "SearchProvider_Search",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v0SearchResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v0SearchRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"SearchProvider"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0Audio": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"album": {
|
||||
"type": "string"
|
||||
},
|
||||
"albumArtist": {
|
||||
"type": "string"
|
||||
},
|
||||
"artist": {
|
||||
"type": "string"
|
||||
},
|
||||
"bitrate": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
},
|
||||
"composers": {
|
||||
"type": "string"
|
||||
},
|
||||
"copyright": {
|
||||
"type": "string"
|
||||
},
|
||||
"disc": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"discCount": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"duration": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
},
|
||||
"genre": {
|
||||
"type": "string"
|
||||
},
|
||||
"hasDrm": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"isVariableBitrate": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"track": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"trackCount": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"year": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0Entity": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ref": {
|
||||
"$ref": "#/definitions/v0Reference"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/definitions/v0ResourceID"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"etag": {
|
||||
"type": "string"
|
||||
},
|
||||
"size": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"lastModifiedTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"mimeType": {
|
||||
"type": "string"
|
||||
},
|
||||
"permissions": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"deleted": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"shareRootName": {
|
||||
"type": "string"
|
||||
},
|
||||
"parentId": {
|
||||
"$ref": "#/definitions/v0ResourceID"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"highlights": {
|
||||
"type": "string"
|
||||
},
|
||||
"audio": {
|
||||
"$ref": "#/definitions/v0Audio"
|
||||
},
|
||||
"location": {
|
||||
"$ref": "#/definitions/v0GeoCoordinates"
|
||||
},
|
||||
"remoteItemId": {
|
||||
"$ref": "#/definitions/v0ResourceID"
|
||||
},
|
||||
"image": {
|
||||
"$ref": "#/definitions/v0Image"
|
||||
},
|
||||
"photo": {
|
||||
"$ref": "#/definitions/v0Photo"
|
||||
},
|
||||
"favorites": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0GeoCoordinates": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"altitude": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"latitude": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"longitude": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0Image": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"width": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"height": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0IndexSpaceRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"spaceId": {
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "string"
|
||||
},
|
||||
"forceReindex": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0IndexSpaceResponse": {
|
||||
"type": "object"
|
||||
},
|
||||
"v0Match": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity": {
|
||||
"$ref": "#/definitions/v0Entity",
|
||||
"title": "the matched entity"
|
||||
},
|
||||
"score": {
|
||||
"type": "number",
|
||||
"format": "float",
|
||||
"title": "the match score"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0Photo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cameraMake": {
|
||||
"type": "string"
|
||||
},
|
||||
"cameraModel": {
|
||||
"type": "string"
|
||||
},
|
||||
"exposureDenominator": {
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
},
|
||||
"exposureNumerator": {
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
},
|
||||
"fNumber": {
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
},
|
||||
"focalLength": {
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
},
|
||||
"iso": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"orientation": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"takenDateTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0Reference": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"resourceId": {
|
||||
"$ref": "#/definitions/v0ResourceID"
|
||||
},
|
||||
"path": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0ResourceID": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"storageId": {
|
||||
"type": "string"
|
||||
},
|
||||
"opaqueId": {
|
||||
"type": "string"
|
||||
},
|
||||
"spaceId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0SearchIndexRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pageSize": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "Optional. The maximum number of entries to return in the response"
|
||||
},
|
||||
"pageToken": {
|
||||
"type": "string",
|
||||
"title": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue"
|
||||
},
|
||||
"query": {
|
||||
"type": "string"
|
||||
},
|
||||
"ref": {
|
||||
"$ref": "#/definitions/v0Reference"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0SearchIndexResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"matches": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v0Match"
|
||||
}
|
||||
},
|
||||
"nextPageToken": {
|
||||
"type": "string",
|
||||
"title": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list"
|
||||
},
|
||||
"totalMatches": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0SearchRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pageSize": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "Optional. The maximum number of entries to return in the response"
|
||||
},
|
||||
"pageToken": {
|
||||
"type": "string",
|
||||
"title": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue"
|
||||
},
|
||||
"query": {
|
||||
"type": "string"
|
||||
},
|
||||
"ref": {
|
||||
"$ref": "#/definitions/v0Reference"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0SearchResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"matches": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v0Match"
|
||||
}
|
||||
},
|
||||
"nextPageToken": {
|
||||
"type": "string",
|
||||
"title": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list"
|
||||
},
|
||||
"totalMatches": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"externalDocs": {
|
||||
"description": "Developer Manual",
|
||||
"url": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: qsfera/services/search/v0/search.proto
|
||||
|
||||
package v0
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
SearchProvider_Search_FullMethodName = "/qsfera.services.search.v0.SearchProvider/Search"
|
||||
SearchProvider_IndexSpace_FullMethodName = "/qsfera.services.search.v0.SearchProvider/IndexSpace"
|
||||
)
|
||||
|
||||
// SearchProviderClient is the client API for SearchProvider service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type SearchProviderClient interface {
|
||||
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
|
||||
IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...grpc.CallOption) (*IndexSpaceResponse, error)
|
||||
}
|
||||
|
||||
type searchProviderClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSearchProviderClient(cc grpc.ClientConnInterface) SearchProviderClient {
|
||||
return &searchProviderClient{cc}
|
||||
}
|
||||
|
||||
func (c *searchProviderClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SearchResponse)
|
||||
err := c.cc.Invoke(ctx, SearchProvider_Search_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *searchProviderClient) IndexSpace(ctx context.Context, in *IndexSpaceRequest, opts ...grpc.CallOption) (*IndexSpaceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(IndexSpaceResponse)
|
||||
err := c.cc.Invoke(ctx, SearchProvider_IndexSpace_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SearchProviderServer is the server API for SearchProvider service.
|
||||
// All implementations must embed UnimplementedSearchProviderServer
|
||||
// for forward compatibility.
|
||||
type SearchProviderServer interface {
|
||||
Search(context.Context, *SearchRequest) (*SearchResponse, error)
|
||||
IndexSpace(context.Context, *IndexSpaceRequest) (*IndexSpaceResponse, error)
|
||||
mustEmbedUnimplementedSearchProviderServer()
|
||||
}
|
||||
|
||||
// UnimplementedSearchProviderServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSearchProviderServer struct{}
|
||||
|
||||
func (UnimplementedSearchProviderServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Search not implemented")
|
||||
}
|
||||
func (UnimplementedSearchProviderServer) IndexSpace(context.Context, *IndexSpaceRequest) (*IndexSpaceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IndexSpace not implemented")
|
||||
}
|
||||
func (UnimplementedSearchProviderServer) mustEmbedUnimplementedSearchProviderServer() {}
|
||||
func (UnimplementedSearchProviderServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSearchProviderServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SearchProviderServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSearchProviderServer interface {
|
||||
mustEmbedUnimplementedSearchProviderServer()
|
||||
}
|
||||
|
||||
func RegisterSearchProviderServer(s grpc.ServiceRegistrar, srv SearchProviderServer) {
|
||||
// If the following call panics, it indicates UnimplementedSearchProviderServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&SearchProvider_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SearchProvider_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.(SearchProviderServer).Search(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SearchProvider_Search_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SearchProviderServer).Search(ctx, req.(*SearchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SearchProvider_IndexSpace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IndexSpaceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SearchProviderServer).IndexSpace(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SearchProvider_IndexSpace_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SearchProviderServer).IndexSpace(ctx, req.(*IndexSpaceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SearchProvider_ServiceDesc is the grpc.ServiceDesc for SearchProvider service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SearchProvider_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "qsfera.services.search.v0.SearchProvider",
|
||||
HandlerType: (*SearchProviderServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Search",
|
||||
Handler: _SearchProvider_Search_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IndexSpace",
|
||||
Handler: _SearchProvider_IndexSpace_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "qsfera/services/search/v0/search.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
IndexProvider_Search_FullMethodName = "/qsfera.services.search.v0.IndexProvider/Search"
|
||||
)
|
||||
|
||||
// IndexProviderClient is the client API for IndexProvider service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type IndexProviderClient interface {
|
||||
Search(ctx context.Context, in *SearchIndexRequest, opts ...grpc.CallOption) (*SearchIndexResponse, error)
|
||||
}
|
||||
|
||||
type indexProviderClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewIndexProviderClient(cc grpc.ClientConnInterface) IndexProviderClient {
|
||||
return &indexProviderClient{cc}
|
||||
}
|
||||
|
||||
func (c *indexProviderClient) Search(ctx context.Context, in *SearchIndexRequest, opts ...grpc.CallOption) (*SearchIndexResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SearchIndexResponse)
|
||||
err := c.cc.Invoke(ctx, IndexProvider_Search_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// IndexProviderServer is the server API for IndexProvider service.
|
||||
// All implementations must embed UnimplementedIndexProviderServer
|
||||
// for forward compatibility.
|
||||
type IndexProviderServer interface {
|
||||
Search(context.Context, *SearchIndexRequest) (*SearchIndexResponse, error)
|
||||
mustEmbedUnimplementedIndexProviderServer()
|
||||
}
|
||||
|
||||
// UnimplementedIndexProviderServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedIndexProviderServer struct{}
|
||||
|
||||
func (UnimplementedIndexProviderServer) Search(context.Context, *SearchIndexRequest) (*SearchIndexResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Search not implemented")
|
||||
}
|
||||
func (UnimplementedIndexProviderServer) mustEmbedUnimplementedIndexProviderServer() {}
|
||||
func (UnimplementedIndexProviderServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeIndexProviderServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to IndexProviderServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeIndexProviderServer interface {
|
||||
mustEmbedUnimplementedIndexProviderServer()
|
||||
}
|
||||
|
||||
func RegisterIndexProviderServer(s grpc.ServiceRegistrar, srv IndexProviderServer) {
|
||||
// If the following call panics, it indicates UnimplementedIndexProviderServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&IndexProvider_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _IndexProvider_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SearchIndexRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IndexProviderServer).Search(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IndexProvider_Search_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IndexProviderServer).Search(ctx, req.(*SearchIndexRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// IndexProvider_ServiceDesc is the grpc.ServiceDesc for IndexProvider service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var IndexProvider_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "qsfera.services.search.v0.IndexProvider",
|
||||
HandlerType: (*IndexProviderServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Search",
|
||||
Handler: _IndexProvider_Search_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "qsfera/services/search/v0/search.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user