server

package
v0.0.0-...-c7f2a34 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

copied from tendermint privval

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJsonApiServer

func NewJsonApiServer(port int, logger log.Logger, privVal types.PrivValidator, chainID string, gatherer prometheus.Gatherer) *http.Server

func OKHandler

func OKHandler(w http.ResponseWriter, _ *http.Request)

OKHandler returns status 200 code only

func Routes

func Routes(privVal types.PrivValidator, chainID string) *http.ServeMux

func WithCORS

func WithCORS(next http.Handler) http.Handler

WithCORS enables CORS

func WithDebugger

func WithDebugger(logger log.Logger, next http.Handler) http.Handler

WithDebugger prints request data and response code to debug log

func WithLeaderOnly

func WithLeaderOnly(leaderPathPrefix string, state interface{}, next http.Handler) http.Handler

func WithPrometheus

func WithPrometheus(handlerName string, requestMetrics *HttpMetrics, next http.Handler) http.Handler

WithPrometheus returns a http.Handler that captures telemetry requestMetrics for every request.

Types

type HttpMetrics

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

func NewHttpMetrics

func NewHttpMetrics(reg prometheus.Registerer) *HttpMetrics

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*ResponseWriter) CloseNotify

func (w *ResponseWriter) CloseNotify() <-chan bool

func (*ResponseWriter) Flush

func (w *ResponseWriter) Flush()

func (*ResponseWriter) Hijack

func (w *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(b []byte) (int, error)

func (*ResponseWriter) WriteHeader

func (w *ResponseWriter) WriteHeader(s int)

func (*ResponseWriter) Written

func (w *ResponseWriter) Written() bool

Jump to

Keyboard shortcuts

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