pond

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultMask = "***"

Variables

This section is empty.

Functions

func WithRequestContext

func WithRequestContext(ctx context.Context, req RequestContext) context.Context

Types

type CollectedContext

type CollectedContext struct {
	IP          string
	URL         string
	Method      string
	Headers     map[string]any
	QueryParams map[string]any
	BodyParams  map[string]any
	Cookies     map[string]any
	Session     map[string]any
	Files       map[string]any
	Env         map[string]any
}

type Config

type Config struct {
	SensitiveFields      []string
	SensitiveHeaderNames []string
	Mask                 string
	EnvProvider          func() map[string]string
}

type Pond

type Pond struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) *Pond

func Ripple

func Ripple(sensitiveFields []string) *Pond

func (*Pond) Collect

func (p *Pond) Collect(ctx context.Context) CollectedContext

func (*Pond) SanitizeHeaders

func (p *Pond) SanitizeHeaders(headers map[string]any) map[string]any

func (*Pond) SanitizeMap

func (p *Pond) SanitizeMap(values map[string]any) map[string]any

func (*Pond) SanitizeValue

func (p *Pond) SanitizeValue(value any) any

type RequestContext

type RequestContext struct {
	IP          string
	URL         string
	Method      string
	Headers     map[string]any
	QueryParams map[string]any
	BodyParams  map[string]any
	Cookies     map[string]any
	Session     map[string]any
	Files       map[string]any
}

func RequestContextFromContext

func RequestContextFromContext(ctx context.Context) (RequestContext, bool)

Jump to

Keyboard shortcuts

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