...

Package redact

import "github.com/google/go-containerregistry/internal/redact"
Overview
Index

Overview ▾

Package redact contains a simple context signal for redacting requests.

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.