dispatcher

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "duration_seconds",
			Help:      "The index operation durations in seconds.",
		},
		[]string{
			"func",
		},
	)
	OperationsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "operations_total",
			Help:      "The number of index operations.",
		},
		[]string{
			"func",
		},
	)
)

Functions

func NewRouter

func NewRouter(grpcAddr string, logger *log.Logger) (*blasthttp.Router, error)

func RecordMetrics

func RecordMetrics(start time.Time, funcName string)

Types

type DeleteHandler

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

func NewDeleteDocumentHandler

func NewDeleteDocumentHandler(client *grpc.Client, logger *log.Logger) *DeleteHandler

func (*DeleteHandler) ServeHTTP

func (h *DeleteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GRPCService

type GRPCService struct {
	*grpc.Service
	// contains filtered or unexported fields
}

func NewGRPCService

func NewGRPCService(managerAddr string, logger *log.Logger) (*GRPCService, error)

func (*GRPCService) DeleteDocument

func (s *GRPCService) DeleteDocument(stream protobuf.Blast_DeleteDocumentServer) error

func (*GRPCService) GetDocument

func (*GRPCService) IndexDocument

func (s *GRPCService) IndexDocument(stream protobuf.Blast_IndexDocumentServer) error

func (*GRPCService) Search

func (*GRPCService) Start

func (s *GRPCService) Start() error

func (*GRPCService) Stop

func (s *GRPCService) Stop() error

type GetHandler

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

func NewGetDocumentHandler

func NewGetDocumentHandler(client *grpc.Client, logger *log.Logger) *GetHandler

func (*GetHandler) ServeHTTP

func (h *GetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IndexHandler

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

func NewSetDocumentHandler

func NewSetDocumentHandler(client *grpc.Client, logger *log.Logger) *IndexHandler

func (*IndexHandler) ServeHTTP

func (h *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RootHandler

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

func NewRootHandler

func NewRootHandler(logger *log.Logger) *RootHandler

func (*RootHandler) ServeHTTP

func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SearchHandler

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

func NewSearchHandler

func NewSearchHandler(client *grpc.Client, logger *log.Logger) *SearchHandler

func (*SearchHandler) ServeHTTP

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

type Server

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

func NewServer

func NewServer(managerAddr string, grpcAddr string, httpAddr string, logger *log.Logger, httpLogger accesslog.Logger) (*Server, error)

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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