Documentation ¶
Index ¶
- func BindAppJson(c *gin.Context, inf interface{}) error
- func ComposeURI(r *http.Request, id string) string
- func CreateIndexRequest2Proto(ci CreateIndexRequest) *index.CreateIndexRequest
- func ParseTime(s string) (time.Time, error)
- func PatchIndexRecordsRequest2Proto(pr PatchRecordsRequest) *index.PatchRecordsRequest
- func Record2Proto(r *Record) *index.Record
- func Records2Proto(rs []*Record) []*index.Record
- func ResolveHost(r *http.Request) (host string)
- func ResolveScheme(r *http.Request) string
- type CreateIndexRequest
- type ErrorMsg
- type HttpEP
- type IndexRecord
- type ListRecordsResult
- type PatchRecordsRequest
- type Record
- type SearchRecordsResult
- type Service
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 CreateIndexRequest2Proto ¶ added in v0.17.0
func CreateIndexRequest2Proto(ci CreateIndexRequest) *index.CreateIndexRequest
func PatchIndexRecordsRequest2Proto ¶ added in v0.17.0
func PatchIndexRecordsRequest2Proto(pr PatchRecordsRequest) *index.PatchRecordsRequest
func Record2Proto ¶ added in v0.17.0
func Record2Proto(r *Record) *index.Record
func Records2Proto ¶ added in v0.17.0
func Records2Proto(rs []*Record) []*index.Record
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 CreateIndexRequest ¶ added in v0.17.0
type CreateIndexRequest struct { // id contains the index identifier. It may be generated or provided. If provided, caller must // support it. id cannot be more than 256 bytes long Id string `json:"id,omitempty"` // format name. Format must exist Format string `json:"format,omitempty"` // tags associated with the index. May be empty. Tags map[string]string `json:"tags,omitempty"` // document contains the binary data for the format provided. It may be empty Document []byte `json:"document,omitempty"` // records contains the list of records that can be added to the index when it is created Records []*Record `json:"records,omitempty"` }
type HttpEP ¶
type HttpEP struct {
// contains filtered or unexported fields
}
HttpEP provides the api endpoints for the HTTP interface
type IndexRecord ¶ added in v0.17.0
type IndexRecord struct { IndexId string `json:"indexId,omitempty"` IndexRecord *Record `json:"indexRecord,omitempty"` }
func IndexRecord2Rest ¶ added in v0.17.0
func IndexRecord2Rest(ir *index.IndexRecord) *IndexRecord
func IndexRecords2Rest ¶ added in v0.17.0
func IndexRecords2Rest(irs []*index.IndexRecord) []*IndexRecord
type ListRecordsResult ¶ added in v0.17.0
type ListRecordsResult struct { Records []*Record `json:"records,omitempty"` NextRecordId *string `json:"nextRecordId,omitempty"` }
func ListRecordsResult2Proto ¶ added in v0.17.0
func ListRecordsResult2Proto(lrr *index.ListRecordsResult) ListRecordsResult
type PatchRecordsRequest ¶ added in v0.17.0
type PatchRecordsRequest struct { // id is the patched index id Id string `json:"id,omitempty"` // upsertRecords contains the list of records that should be inserted or updated UpsertRecords []*Record `json:"upsertRecords,omitempty"` // deleteRecords contains the list of records that should be deleted DeleteRecords []*Record `json:"deleteRecords,omitempty"` }
type Record ¶ added in v0.17.0
type Record struct { // id is the record id - this field is populated by parser or it is provided when records are created. Id string `json:"id,omitempty"` // segment contains the searchable text for the record Segment string `json:"segment,omitempty"` // vector is the list of the byte values (stringified) ordered according the basis fields definition Vector json.RawMessage `json:"vector,omitempty"` }
func Record2Rest ¶ added in v0.17.0
func Record2Rest(r *index.Record) *Record
func Records2Rest ¶ added in v0.17.0
func Records2Rest(rs []*index.Record) []*Record
type SearchRecordsResult ¶ added in v0.17.0
type SearchRecordsResult struct { Records []*IndexRecord `json:"records,omitempty"` NextPageId *string `json:"nextPageId,omitempty"` }
func SearchRecordsResult2Rest ¶ added in v0.17.0
func SearchRecordsResult2Rest(srr *index.SearchRecordsResult) SearchRecordsResult
type Service ¶
type Service struct { PProvider parser.Provider `inject:""` Db persistence.Db `inject:""` // 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.