scrub

package
v1.35.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(input []byte, paths []Path, replaceWith []byte) (scrubbed []byte)

JSON scrubs the input JSON data, substituting values at the given paths with replaceWith.

It returns the scrubbed data. If no substitutions were made scrubbed is the same slice as input.

Types

type Bounds

type Bounds struct {
	From, To int
}

func JSONIndices

func JSONIndices(input []byte, paths []Path) []Bounds

JSONIndices computes the indices to replace in order to scrub the input JSON data.

type EntryKind

type EntryKind int
const (
	ObjectField EntryKind = iota
	MapKey
	MapValue
)

type Path

type Path []PathEntry

type PathEntry

type PathEntry struct {
	Kind          EntryKind
	FieldName     string
	CaseSensitive bool
}

Directories

Path Synopsis
Package metascrub computes scrub paths for a metadata type.
Package metascrub computes scrub paths for a metadata type.

Jump to

Keyboard shortcuts

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