redact

package
v0.20.0 Latest Latest
Warning

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

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

Documentation

Overview

Package redact contains a simple context signal for redacting requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error added in v0.11.0

func Error(err error) error

Error redacts potentially sensitive query parameter values in the URL from the error's message.

If the error is a *url.Error, this returns a *url.Error with the URL redacted. Any other error type, or nil, is returned unchanged.

func FromContext

func FromContext(ctx context.Context) (bool, string)

FromContext returns the redaction reason, if any.

func NewContext

func NewContext(ctx context.Context, reason string) context.Context

NewContext creates a new ctx with the reason for redaction.

func URL added in v0.11.0

func URL(u *url.URL) *url.URL

URL redacts potentially sensitive query parameter values from the URL's query string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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