utilhealthz

package
v0.0.0-...-aca9518 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewServer = utilhttp.DeclareServer(
	func(_ Args) string { return "healthz" },
	defaultHttpPort, defaultHttpsPort,
	func(_ Args, _ *flag.FlagSet) Options {
		return Options{}
	},
	func(_ Args, requests *component.DepRequests) Deps {
		return Deps{
			Observer: o11y.Request[observer.Observer](requests),
		}
	},
	func(args Args, _ Options, _ Deps, mux *http.ServeMux) (*State, error) {
		mux.Handle("/readyz", http.StripPrefix("/readyz", args.Handler))
		mux.Handle("/readyz/", http.StripPrefix("/readyz/", args.Handler))

		return &State{}, nil
	},
	component.Lifecycle[Args, Options, Deps, State]{
		Start:        nil,
		Join:         nil,
		HealthChecks: nil,
	},
	func(_ Args, _ Options, deps Deps, _ *State) *Api {
		return &Api{
			observer: deps.Observer.Get(),
		}
	},
)

Functions

This section is empty.

Types

type Api

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

func (*Api) OnHealthCheckFailed

func (api *Api) OnHealthCheckFailed(ctx context.Context, name string, err error)

type Args

type Args struct {
	Handler *healthz.Handler
}

type Deps

type Deps struct {
	Observer component.Dep[observer.Observer]
}

type Options

type Options struct{}

type State

type State struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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