Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterIndexServer(s grpc.ServiceRegistrar, srv IndexServer)
- type Client
- func (c *Client) Delete(ctx context.Context, ids ...string) error
- func (c *Client) Index(ctx context.Context, documents ...index.Document) error
- func (c *Client) List(ctx context.Context, options *index.ListOptions) ([]index.Document, error)
- func (c *Client) Query(ctx context.Context, query string, options *index.QueryOptions) ([]index.Result, error)
- type DeleteRequest
- type Document
- func (*Document) Descriptor() ([]byte, []int)deprecated
- func (x *Document) GetContent() string
- func (x *Document) GetEmbedding() []float32
- func (x *Document) GetId() string
- func (x *Document) GetLocation() string
- func (x *Document) GetMetadata() map[string]string
- func (x *Document) GetTitle() string
- func (*Document) ProtoMessage()
- func (x *Document) ProtoReflect() protoreflect.Message
- func (x *Document) Reset()
- func (x *Document) String() string
- type Documents
- type IndexClient
- type IndexRequest
- type IndexServer
- type ListRequest
- type Option
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetFilters() map[string]string
- func (x *QueryRequest) GetLimit() int32
- func (x *QueryRequest) GetQuery() string
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) String() string
- type Result
- type Results
- type UnimplementedIndexServer
- func (UnimplementedIndexServer) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
- func (UnimplementedIndexServer) Index(context.Context, *IndexRequest) (*emptypb.Empty, error)
- func (UnimplementedIndexServer) List(context.Context, *ListRequest) (*Documents, error)
- func (UnimplementedIndexServer) Query(context.Context, *QueryRequest) (*Results, error)
- type UnsafeIndexServer
Constants ¶
const ( Index_List_FullMethodName = "/index.index/List" Index_Delete_FullMethodName = "/index.index/Delete" Index_Index_FullMethodName = "/index.index/Index" Index_Query_FullMethodName = "/index.index/Query" )
Variables ¶
var File_index_proto protoreflect.FileDescriptor
var Index_ServiceDesc = grpc.ServiceDesc{ ServiceName: "index.index", HandlerType: (*IndexServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _Index_List_Handler, }, { MethodName: "Delete", Handler: _Index_Delete_Handler, }, { MethodName: "Index", Handler: _Index_Index_Handler, }, { MethodName: "Query", Handler: _Index_Query_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "index.proto", }
Index_ServiceDesc is the grpc.ServiceDesc for Index service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterIndexServer ¶
func RegisterIndexServer(s grpc.ServiceRegistrar, srv IndexServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type DeleteRequest ¶
type DeleteRequest struct { Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` // contains filtered or unexported fields }
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetIds ¶
func (x *DeleteRequest) GetIds() []string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type Document ¶
type Document struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Embedding []float32 `protobuf:"fixed32,6,rep,packed,name=embedding,proto3" json:"embedding,omitempty"` // contains filtered or unexported fields }
func (*Document) Descriptor
deprecated
func (*Document) GetContent ¶
func (*Document) GetEmbedding ¶
func (*Document) GetLocation ¶
func (*Document) GetMetadata ¶
func (*Document) ProtoMessage ¶
func (*Document) ProtoMessage()
func (*Document) ProtoReflect ¶
func (x *Document) ProtoReflect() protoreflect.Message
type Documents ¶
type Documents struct { Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"` // contains filtered or unexported fields }
func (*Documents) Descriptor
deprecated
func (*Documents) GetDocuments ¶
func (*Documents) ProtoMessage ¶
func (*Documents) ProtoMessage()
func (*Documents) ProtoReflect ¶
func (x *Documents) ProtoReflect() protoreflect.Message
type IndexClient ¶
type IndexClient interface { List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*Documents, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Index(ctx context.Context, in *IndexRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*Results, error) }
IndexClient is the client API for Index 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.
func NewIndexClient ¶
func NewIndexClient(cc grpc.ClientConnInterface) IndexClient
type IndexRequest ¶
type IndexRequest struct { Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"` // contains filtered or unexported fields }
func (*IndexRequest) Descriptor
deprecated
func (*IndexRequest) Descriptor() ([]byte, []int)
Deprecated: Use IndexRequest.ProtoReflect.Descriptor instead.
func (*IndexRequest) GetDocuments ¶
func (x *IndexRequest) GetDocuments() []*Document
func (*IndexRequest) ProtoMessage ¶
func (*IndexRequest) ProtoMessage()
func (*IndexRequest) ProtoReflect ¶
func (x *IndexRequest) ProtoReflect() protoreflect.Message
func (*IndexRequest) Reset ¶
func (x *IndexRequest) Reset()
func (*IndexRequest) String ¶
func (x *IndexRequest) String() string
type IndexServer ¶
type IndexServer interface { List(context.Context, *ListRequest) (*Documents, error) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error) Index(context.Context, *IndexRequest) (*emptypb.Empty, error) Query(context.Context, *QueryRequest) (*Results, error) // contains filtered or unexported methods }
IndexServer is the server API for Index service. All implementations must embed UnimplementedIndexServer for forward compatibility.
type ListRequest ¶
type ListRequest struct {
// contains filtered or unexported fields
}
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type QueryRequest ¶
type QueryRequest struct { Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` Limit *int32 `protobuf:"varint,2,opt,name=limit,proto3,oneof" json:"limit,omitempty"` Filters map[string]string `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*QueryRequest) Descriptor
deprecated
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetFilters ¶
func (x *QueryRequest) GetFilters() map[string]string
func (*QueryRequest) GetLimit ¶
func (x *QueryRequest) GetLimit() int32
func (*QueryRequest) GetQuery ¶
func (x *QueryRequest) GetQuery() string
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶
func (x *QueryRequest) String() string
type Result ¶
type Result struct { Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` Score float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"` // contains filtered or unexported fields }
func (*Result) Descriptor
deprecated
func (*Result) GetDocument ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
type Results ¶
type Results struct { Results []*Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
func (*Results) Descriptor
deprecated
func (*Results) GetResults ¶
func (*Results) ProtoMessage ¶
func (*Results) ProtoMessage()
func (*Results) ProtoReflect ¶
func (x *Results) ProtoReflect() protoreflect.Message
type UnimplementedIndexServer ¶
type UnimplementedIndexServer struct{}
UnimplementedIndexServer 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.
func (UnimplementedIndexServer) Delete ¶
func (UnimplementedIndexServer) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
func (UnimplementedIndexServer) Index ¶
func (UnimplementedIndexServer) Index(context.Context, *IndexRequest) (*emptypb.Empty, error)
func (UnimplementedIndexServer) List ¶
func (UnimplementedIndexServer) List(context.Context, *ListRequest) (*Documents, error)
func (UnimplementedIndexServer) Query ¶
func (UnimplementedIndexServer) Query(context.Context, *QueryRequest) (*Results, error)
type UnsafeIndexServer ¶
type UnsafeIndexServer interface {
// contains filtered or unexported methods
}
UnsafeIndexServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IndexServer will result in compilation errors.