httpserver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LivenessAffirmativeResponseCode  = http.StatusOK
	LivenessNegativeResponseCode     = http.StatusServiceUnavailable
	ReadinessAffirmativeResponseCode = http.StatusOK
	ReadinessNegativeResponseCode    = http.StatusServiceUnavailable
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr           string `envconfig:"HEALTH_HTTP_REPORTER_ADDR" default:"0.0.0.0"`
	Port           int    `envconfig:"HEALTH_HTTP_REPORTER_PORT" default:"8181"`
	LivenessRoute  string `envconfig:"HEALTH_HTTP_REPORTER_LIVENESS_ROUTE" default:"/live"`
	ReadinessRoute string `envconfig:"HEALTH_HTTP_REPORTER_READINESS_ROUTE" default:"/ready"`
	Logger         health.Logger
}

type Reporter

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

func NewReporter

func NewReporter(cfg Config) *Reporter

NewReporter returns an instance of Reporter with routing and caching already set up.

func (*Reporter) Recover added in v0.2.0

func (r *Reporter) Recover(next http.Handler) http.Handler

func (*Reporter) Run

func (r *Reporter) Run(_ context.Context) error

func (*Reporter) SetLiveness

func (r *Reporter) SetLiveness(_ context.Context, b bool)

func (*Reporter) SetReadiness

func (r *Reporter) SetReadiness(_ context.Context, b bool)

func (*Reporter) Stop

func (r *Reporter) Stop(ctx context.Context) error

func (*Reporter) UpdateHealthChecks

func (r *Reporter) UpdateHealthChecks(_ context.Context, m map[string]*healthpb.Check)

Jump to

Keyboard shortcuts

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