debug

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 28 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 ListenOpts

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

ListenOpts represents Listen options.

type Listener

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

Listener represents TCP listener with debug HTTP handler.

func Listen

func Listen(opts *ListenOpts) (*Listener, 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 (*Listener) Run

func (lis *Listener) Run(ctx context.Context)

Run runs debug handler until ctx is canceled.

It exits when handler is stopped and listener closed.

type Probe

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