package redact
import "github.com/google/go-containerregistry/internal/redact"
Package redact contains a simple context signal for redacting requests.
Index ¶
- func Error(err error) error
- func FromContext(ctx context.Context) (bool, string)
- func NewContext(ctx context.Context, reason string) context.Context
- func URL(u *url.URL) string
Functions ¶
func 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 ¶
FromContext returns the redaction reason, if any.
func NewContext ¶
NewContext creates a new ctx with the reason for redaction.
func URL ¶
URL redacts potentially sensitive query parameter values from the URL's query string.
Source Files ¶
- Version
- v0.20.3 (latest)
- Published
- Jan 15, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 21 hours ago –
Tools for package owners.