redact

package
v0.0.0-...-14de809 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 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

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

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