web

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an HTTP server that handles all http traffic for hound. It is able to serve some traffic before indexes are built and then transition to all traffic afterwards.

func Start

func Start(cfg *config.Config, addr string, dev bool) *Server

Start creates a new server that will immediately start handling HTTP traffic. The HTTP server will return 200 on the health check, but a 503 on every other request until ServeWithIndex is called to begin serving search traffic with the given searchers.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) ServeWithIndex

func (s *Server) ServeWithIndex(idx map[string]*searcher.Searcher) error

ServeWithIndex allow the server to start offering the search UI and the search APIs operating on the given indexes.

Jump to

Keyboard shortcuts

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