diagnostics

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package diagnostics provides opt-in, command-scoped progress on stderr. Callers must supply only public operational metadata, never credentials, command arguments, environments, request bodies, or unfiltered errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Level

func Level(ctx context.Context) int

Level returns zero when diagnostics have not been enabled.

func Printf

func Printf(ctx context.Context, minimum int, format string, args ...any)

Printf writes one diagnostic line when its minimum level is enabled. Formats and arguments must be explicitly selected non-secret metadata.

func Time

func Time(ctx context.Context, operation string) func()

Time returns a completion callback for a named operation at level three. Typical use: defer diagnostics.Time(ctx, "verify release")().

func With

func With(ctx context.Context, level int, out io.Writer) context.Context

With enables up to three cumulative levels: phases, details, and timings. A nil writer discards diagnostics. Child contexts retain cancellation.

Types

type Transport

type Transport struct {
	Base http.RoundTripper
	// Hop and Profile name the controlled hop and its policy for the TLS line.
	Hop     tlspolicy.Hop
	Profile tlspolicy.Profile
}

Transport reports request methods, destination origins and response status. URL paths, queries, userinfo, headers, bodies and error strings are omitted: even a failed transport error can contain an entire credential-bearing URL.

When Hop is set, a completed TLS response also reports the negotiated version and group under the hop's policy profile (#1127). That line is observation of this process's own connection only; it never infers a proxy's or peer-side terminator's group, and it says nothing about certificate authentication.

func (Transport) CloseIdleConnections

func (t Transport) CloseIdleConnections()

CloseIdleConnections preserves http.Client's transport cleanup contract.

func (Transport) RoundTrip

func (t Transport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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