README ¶
REST API v1
/v1/indexes
Index object:
{
id: "the index ID"
format: "pdf"
tags: ["userABC", "salesTeam"]
document: "a base64 encoded document, used for create new index only"
records: [{id: "abcd", segment: "hello world", vector: [1, 2]}]
}
An index record object:
{
id: "a base64 encoded vector"
segment: "this is searcheable piece of the text"
vector: [1, "abc", 3]
}
Create new index
POST /v1/indexes
An index may be created via providing the whole data in the content-type: application/json
body:
curl -XPOST -H "content-type: application/json" -d '{"id": "1234", "format": "pdf"}' http://localhost:8080/v1/indexes
or 'multipart/form-data' is also supported:
example:
curl -i -X POST -H "content-type: multipart/form-data" -F"file=@/Users/user/Downloads/fr_9782_size1024.jpg" -F "meta={\"id\": \"1234\", \"format\": \"jpg\"};type=application/json" http://localhost:8080/v1/indexes
Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindAppJson ¶ added in v0.6.0
BindAppJson turns the request body to inf, but for "application/json" contents only
func ComposeURI ¶ added in v0.6.0
ComposeURI helper function which composes URI, adding ID to the request path
func ResolveHost ¶ added in v0.6.0
ResolveHost returns host part of r
func ResolveScheme ¶ added in v0.6.0
ResolveScheme resolves initial request type by r
Types ¶
type HttpEP ¶
type HttpEP struct {
// contains filtered or unexported fields
}
HttpEP provides the api endpoints for the HTTP interface
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements the gRPC API endpoints
func NewService ¶
func NewService() *Service
func (*Service) FormatServiceServer ¶ added in v0.6.0
func (s *Service) FormatServiceServer() format.ServiceServer
func (*Service) IndexServiceServer ¶ added in v0.6.0
func (s *Service) IndexServiceServer() index.ServiceServer
IndexServiceServer returns index.ServiceServer
Click to show internal directories.
Click to hide internal directories.