models

package
v0.0.0-...-b472cd4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchReq

type BatchReq struct {
	IdField string
	Items   []map[string]any
}

type CreateIndexReq

type CreateIndexReq struct {
	Name        string
	DefaultLang string
	Mapping     IndexMapping
}

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func BadRequestError

func BadRequestError(message string) Error

func ExistsError

func ExistsError() Error

func NotFoundError

func NotFoundError() Error

func ServerError

func ServerError(err error) Error

type FieldMapping

type FieldMapping struct {
	Lang   string
	Fields map[string]FieldMapping
}

type IndexMapping

type IndexMapping struct {
	DocumentType string
	Fields       map[string]FieldMapping
}

type SearchReq

type SearchReq struct {
	Q            string
	SortBy       string
	Page         int
	ItemsPerPage int
}

func (*SearchReq) Validate

func (s *SearchReq) Validate() error

type SearchResult

type SearchResult struct {
	Total uint64 `json:"total"`
	Items []any  `json:"items"`
}

type ServerStats

type ServerStats struct {
	Uptime  string                    `json:"upTime"`
	Indexes map[string]map[string]any `json:"indexes"`
}

Jump to

Keyboard shortcuts

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