api

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port               uint
	MaxMultipartMemory int64
}

type Document

type Document struct {
	Title    string `json:"title" xml:"title" index:"title" binding:"required" `
	Url      string `json:"url" xml:"url" binding:"required"`
	Abstract string `json:"abstract" xml:"abstract" index:"abstract" binding:"required"`
}

type DocumentResponse

type DocumentResponse struct {
	Id       string `json:"id"`
	Title    string `json:"title"`
	Url      string `json:"url"`
	Abstract string `json:"abstract"`
}

type SearchDocument

type SearchDocument struct {
	Id    string   `json:"id"`
	Data  Document `json:"data"`
	Score float64  `json:"score"`
}

type SearchDocumentResponse

type SearchDocumentResponse struct {
	Count   int              `json:"count"`
	Hits    []SearchDocument `json:"hits"`
	Elapsed int64            `json:"elapsed"`
}

type SearchDocumentsParams

type SearchDocumentsParams struct {
	Query      string     `form:"query" binding:"required"`
	Properties string     `form:"properties"`
	BoolMode   store.Mode `form:"bool_mode"`
	Offset     int        `form:"offset"`
	Limit      int        `form:"limit"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) *Server

func (*Server) Run

func (s *Server) Run() error

type UploadDocumentsFileDump

type UploadDocumentsFileDump struct {
	Documents []Document `xml:"doc"`
}

type UploadDocumentsResponse

type UploadDocumentsResponse struct {
	Total   int `json:"total"`
	Success int `json:"success"`
	Fail    int `json:"fail"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL