Documentation ¶
Overview ¶
copied from tendermint privval
Index ¶
- func NewJsonApiServer(port int, logger log.Logger, privVal types.PrivValidator, chainID string, ...) *http.Server
- func OKHandler(w http.ResponseWriter, _ *http.Request)
- func Routes(privVal types.PrivValidator, chainID string) *http.ServeMux
- func WithCORS(next http.Handler) http.Handler
- func WithDebugger(logger log.Logger, next http.Handler) http.Handler
- func WithLeaderOnly(leaderPathPrefix string, state interface{}, next http.Handler) http.Handler
- func WithPrometheus(handlerName string, requestMetrics *HttpMetrics, next http.Handler) http.Handler
- type HttpMetrics
- type ResponseWriter
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 WithDebugger ¶
WithDebugger prints request data and response code to debug log
func WithLeaderOnly ¶
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) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(s int)
func (*ResponseWriter) Written ¶
func (w *ResponseWriter) Written() bool
Click to show internal directories.
Click to hide internal directories.