etcdhttp

package
v3.0.0-...-eac99ac Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Overview

Package etcdhttp implements HTTP transportation layer for etcdserver.

Index

Constants

View Source
const (
	PathHealth      = "/health"
	PathProxyHealth = "/proxy/health"
)
View Source
const (
	PathMetrics      = "/metrics"
	PathProxyMetrics = "/proxy/metrics"
)

Variables

This section is empty.

Functions

func HandleDebug

func HandleDebug(mux *http.ServeMux)

func HandleHealth

func HandleHealth(lg *zap.Logger, mux *http.ServeMux, srv ServerHealth)

HandleHealth registers metrics and health handlers. it checks health by using v3 range request and its corresponding timeout.

func HandleMetrics

func HandleMetrics(mux *http.ServeMux)

HandleMetrics registers prometheus handler on '/metrics'.

func HandleVersion

func HandleVersion(mux *http.ServeMux, server etcdserver.Server)

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.

Types

type AlarmSet

type AlarmSet map[string]struct{}

type Health

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

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

type ServerHealth

type ServerHealth interface {
	Alarms() []*pb.AlarmMember
	Leader() types.ID
	Range(context.Context, *pb.RangeRequest) (*pb.RangeResponse, error)
	Config() config.ServerConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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