Documentation ¶
Overview ¶
Package etcdhttp implements HTTP transportation layer for etcdserver.
Index ¶
- Constants
- func HandleBasic(lg *zap.Logger, mux *http.ServeMux, server etcdserver.ServerPeer)
- func HandleMetricsHealth(lg *zap.Logger, mux *http.ServeMux, srv etcdserver.ServerV2)
- func HandleMetricsHealthForV3(lg *zap.Logger, mux *http.ServeMux, srv *etcdserver.EtcdServer)
- func HandlePrometheus(mux *http.ServeMux)
- func NewHealthHandler(lg *zap.Logger, hfunc func(excludedAlarms AlarmSet, Serializable bool) Health) http.HandlerFunc
- func NewPeerHandler(lg *zap.Logger, s etcdserver.ServerPeerV2) http.Handler
- func WriteError(lg *zap.Logger, w http.ResponseWriter, r *http.Request, err error)
- type AlarmSet
- type Health
Constants ¶
const ( PathMetrics = "/metrics" PathHealth = "/health" PathProxyMetrics = "/proxy/metrics" PathProxyHealth = "/proxy/health" )
Variables ¶
This section is empty.
Functions ¶
func HandleBasic ¶
func HandleBasic(lg *zap.Logger, mux *http.ServeMux, server etcdserver.ServerPeer)
HandleBasic adds handlers to a mux for serving JSON etcd client requests that do not access the v2 store.
func HandleMetricsHealth ¶
HandleMetricsHealth registers metrics and health handlers.
func HandleMetricsHealthForV3 ¶
func HandleMetricsHealthForV3(lg *zap.Logger, mux *http.ServeMux, srv *etcdserver.EtcdServer)
HandleMetricsHealthForV3 registers metrics and health handlers. it checks health by using v3 range request and its corresponding timeout.
func HandlePrometheus ¶
HandlePrometheus registers prometheus handler on '/metrics'.
func NewHealthHandler ¶
func NewHealthHandler(lg *zap.Logger, hfunc func(excludedAlarms AlarmSet, Serializable bool) Health) http.HandlerFunc
NewHealthHandler handles '/health' requests.
func NewPeerHandler ¶
func NewPeerHandler(lg *zap.Logger, s etcdserver.ServerPeerV2) http.Handler
NewPeerHandler generates an http.Handler to handle etcd peer requests.
func WriteError ¶
WriteError logs and writes the given Error to the ResponseWriter If Error is an etcdErr, it is rendered to the ResponseWriter Otherwise, it is assumed to be a StatusInternalServerError