typescrub

package
v1.54.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package typescrub computes scrub paths for schema types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeadersToJen

func HeadersToJen(headers []string) Code

func PathsToJen

func PathsToJen(paths []scrub.Path) Code

Types

type Computer

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

Computer computes scrub paths for types, caching the computation. It can safely be reused across multiple types. It is not safe for concurrent use.

func NewComputer

func NewComputer(log zerolog.Logger) *Computer

New constructs a new Computer.

func (*Computer) Compute

func (c *Computer) Compute(typ schema.Type, mode ParseMode) Desc

Compute computes the scrub paths for the given typ. It is not safe for concurrent use.

type Desc

type Desc struct {
	Payload []scrub.Path
	Headers []string
}

type ParseMode

type ParseMode int
const (
	// AuthHandler specifies that the type is an auth handler.
	AuthHandler ParseMode = 1 << iota
	// DisableScrubbing specifies that scrubbing should be disabled.
	// Used for local development.
	DisableScrubbing
)

Jump to

Keyboard shortcuts

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