debug

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package debug provides debug facilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler added in v1.23.0

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

Handler represents debug handler.

func Listen added in v1.23.0

func Listen(opts *ListenOpts) (*Handler, error)

Listen creates a new debug handler and starts listener on the given TCP address.

This function can be called only once because it affects http.DefaultServeMux.

func (*Handler) Serve added in v1.23.0

func (h *Handler) Serve(ctx context.Context)

Serve runs debug handler until ctx is canceled.

It exits when handler is stopped and listener closed.

type ListenOpts added in v1.23.0

type ListenOpts struct {
	TCPAddr string
	L       *slog.Logger
	R       prometheus.Registerer
	Livez   Probe
	Readyz  Probe
}

ListenOpts represents Listen options.

type Probe added in v1.23.0

type Probe func(ctx context.Context) bool

Probe should return true on success and false on failure (or context cancellation). It may log additional information if needed.

It must be thread-safe.

Jump to

Keyboard shortcuts

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