trace

package
v1.18.9 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package trace provides helpers to format values for protocol trace output.

Index

Constants

View Source
const RedactedText = "xxxxx"

RedactedText is the placeholder text replacing credentials in redacted output. Kept consistent with net/url.URL.Redacted, whose "xxxxx" literal is unexported.

Variables

This section is empty.

Functions

func Cut added in v1.18.5

func Cut(v any) string

Cut formats value for a trace output. Strings are cut by runes and byte slices by bytes once they exceed limit. The "(n)" suffix reports the length of the value before cutting.

func Redact added in v1.18.5

func Redact() bool

Redact reports whether credential redaction in trace output is enabled.

func Redacted added in v1.18.5

func Redacted(v any) string

Redacted returns RedactedText, or the value rendered via Cut when redaction is disabled.

func SetRedact added in v1.18.5

func SetRedact(on bool)

SetRedact enables or disables credential redaction in trace output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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