package etcdhttp

import "github.com/coreos/etcd/etcdserver/api/etcdhttp"

Package etcdhttp implements HTTP transportation layer for etcdserver.

Index

Constants

const (
	PathHealth = "/health"
)

Functions

func HandleBasic

func HandleBasic(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 HandleHealth

func HandleHealth(mux *http.ServeMux, srv etcdserver.ServerV2)

HandleHealth registers health handler on '/health'.

func HandleMetricsHealth

func HandleMetricsHealth(mux *http.ServeMux, srv etcdserver.ServerV2)

HandleMetricsHealth registers metrics and health handlers.

func HandlePrometheus

func HandlePrometheus(mux *http.ServeMux)

HandlePrometheus registers prometheus handler on '/metrics'.

func NewHealthHandler

func NewHealthHandler(hfunc func() Health) http.HandlerFunc

NewHealthHandler handles '/health' requests.

func NewPeerHandler

func NewPeerHandler(s etcdserver.ServerPeer) http.Handler

NewPeerHandler generates an http.Handler to handle etcd peer requests.

func WriteError

func WriteError(w http.ResponseWriter, r *http.Request, err error)

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

Types

type Health

type Health struct {
	Health string `json:"health"`
}

Health defines etcd server health status. TODO: remove manual parsing in etcdctl cluster-health

Source Files

base.go doc.go metrics.go peer.go

Version
v3.3.2+incompatible
Published
Mar 8, 2018
Platform
linux/amd64
Imports
19 packages
Last checked
21 minutes ago

Tools for package owners.