http

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 7

README

http support in bleve

This http package is purely for the demonstration purposes and is used by sample applications like https://github.com/blevesearch/bleve-explorer.

Please be aware that the http handler implementations neither provide exhaustive user input validations nor authentication or authorization of the user access.

So, it is strongly recommended that users exercise caution while using the http package in production situations.

Here is the security advisory on this.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexByName

func IndexByName(name string) bleve.Index

func IndexNames

func IndexNames() []string

func RegisterIndexName

func RegisterIndexName(name string, idx bleve.Index)

func SetLog

func SetLog(l *log.Logger)

SetLog sets the logger used for logging by default log messages are sent to io.Discard

func UnregisterIndexByName

func UnregisterIndexByName(name string) bleve.Index

func UpdateAlias

func UpdateAlias(alias string, add, remove []string) error

Types

type AliasAction

type AliasAction struct {
	Alias         string   `json:"alias"`
	AddIndexes    []string `json:"add"`
	RemoveIndexes []string `json:"remove"`
}

type AliasHandler

type AliasHandler struct{}

func NewAliasHandler

func NewAliasHandler() *AliasHandler

func (*AliasHandler) ServeHTTP

func (h *AliasHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type CreateIndexHandler

type CreateIndexHandler struct {
	IndexNameLookup varLookupFunc
	// contains filtered or unexported fields
}

func NewCreateIndexHandler

func NewCreateIndexHandler(basePath string) *CreateIndexHandler

func (*CreateIndexHandler) ServeHTTP

func (h *CreateIndexHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type DebugDocumentHandler

type DebugDocumentHandler struct {
	IndexNameLookup varLookupFunc
	DocIDLookup     varLookupFunc
	// contains filtered or unexported fields
}

DebugDocumentHandler allows you to debug the index content for a given document id.

func NewDebugDocumentHandler

func NewDebugDocumentHandler(defaultIndexName string) *DebugDocumentHandler

func (*DebugDocumentHandler) ServeHTTP

func (h *DebugDocumentHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type DeleteIndexHandler

type DeleteIndexHandler struct {
	IndexNameLookup varLookupFunc
	// contains filtered or unexported fields
}

func NewDeleteIndexHandler

func NewDeleteIndexHandler(basePath string) *DeleteIndexHandler

func (*DeleteIndexHandler) ServeHTTP

func (h *DeleteIndexHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type DocCountHandler

type DocCountHandler struct {
	IndexNameLookup varLookupFunc
	// contains filtered or unexported fields
}

func NewDocCountHandler

func NewDocCountHandler(defaultIndexName string) *DocCountHandler

func (*DocCountHandler) ServeHTTP

func (h *DocCountHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type DocDeleteHandler

type DocDeleteHandler struct {
	IndexNameLookup varLookupFunc
	DocIDLookup     varLookupFunc
	// contains filtered or unexported fields
}

func NewDocDeleteHandler

func NewDocDeleteHandler(defaultIndexName string) *DocDeleteHandler

func (*DocDeleteHandler) ServeHTTP

func (h *DocDeleteHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type DocGetHandler

type DocGetHandler struct {
	IndexNameLookup varLookupFunc
	DocIDLookup     varLookupFunc
	// contains filtered or unexported fields
}

func NewDocGetHandler

func NewDocGetHandler(defaultIndexName string) *DocGetHandler

func (*DocGetHandler) ServeHTTP

func (h *DocGetHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type DocIndexHandler

type DocIndexHandler struct {
	IndexNameLookup varLookupFunc
	DocIDLookup     varLookupFunc
	// contains filtered or unexported fields
}

func NewDocIndexHandler

func NewDocIndexHandler(defaultIndexName string) *DocIndexHandler

func (*DocIndexHandler) ServeHTTP

func (h *DocIndexHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GetIndexHandler

type GetIndexHandler struct {
	IndexNameLookup varLookupFunc
}

func NewGetIndexHandler

func NewGetIndexHandler() *GetIndexHandler

func (*GetIndexHandler) ServeHTTP

func (h *GetIndexHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ListFieldsHandler

type ListFieldsHandler struct {
	IndexNameLookup varLookupFunc
	// contains filtered or unexported fields
}

func NewListFieldsHandler

func NewListFieldsHandler(defaultIndexName string) *ListFieldsHandler

func (*ListFieldsHandler) ServeHTTP

func (h *ListFieldsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ListIndexesHandler

type ListIndexesHandler struct {
}

func NewListIndexesHandler

func NewListIndexesHandler() *ListIndexesHandler

func (*ListIndexesHandler) ServeHTTP

func (h *ListIndexesHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type SearchHandler

type SearchHandler struct {
	IndexNameLookup varLookupFunc
	// contains filtered or unexported fields
}

SearchHandler can handle search requests sent over HTTP

func NewSearchHandler

func NewSearchHandler(defaultIndexName string) *SearchHandler

func (*SearchHandler) ServeHTTP

func (h *SearchHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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