httpapi

package
v0.0.0-...-06c96c1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCommonSearchService

func BuildCommonSearchService(ctx context.Context, indexNames []string, query elastic.Query, sorts []elastic.SortInfo, fsc *elastic.FetchSourceContext) *elastic.SearchService

func ExtractSources

func ExtractSources(results *elastic.SearchResult, pretty bool) ([]*json.RawMessage, string)

func GenerateNextAfter

func GenerateNextAfter(hit *elastic.SearchHit) string

func GetFromFromContext

func GetFromFromContext(ctx context.Context) int

func GetPrettyJsonFromContext

func GetPrettyJsonFromContext(ctx context.Context) bool

func GetSearchAfterFromContext

func GetSearchAfterFromContext(ctx context.Context) []interface{}

func GetSizeFromContext

func GetSizeFromContext(ctx context.Context) int

func GetSortInfoFromContext

func GetSortInfoFromContext(ctx context.Context) []elastic.SortInfo

func NewSubRoute

func NewSubRoute(prefix string) *mux.Router

func RespondESError

func RespondESError(ctx context.Context, w http.ResponseWriter, err error)

func RespondJSON

func RespondJSON(ctx context.Context, w http.ResponseWriter, code int, payload interface{})

func RespondSearch

func RespondSearch(ctx context.Context, w http.ResponseWriter, searchService *elastic.SearchService)

func Serve

func Serve()

Types

This section is empty.

Jump to

Keyboard shortcuts

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