pii

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PIITypeEmail = PIIType(tokenizer.TokenEmail)
	PIITypeIPv4  = PIIType(tokenizer.TokenIPv4)
	PIITypeURL   = PIIType(tokenizer.TokenURL)
	PIITypeFQDN  = PIIType(tokenizer.TokenFQDN)
	PIITypePhone = PIIType(tokenizer.TokenPhone)
	PIITypeSSN   = PIIType(tokenizer.TokenSSN)
	PIITypeCCN   = PIIType(tokenizer.TokenCCN)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

type Detector interface {
	Tokenize(input string) ([]Token, error)
	Sanitize(input string, tokens []Token) string
}

type DetectorImpl

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

func NewDetector

func NewDetector(opts ...Option) *DetectorImpl

func (*DetectorImpl) Sanitize added in v0.5.0

func (fp *DetectorImpl) Sanitize(input string, tokens []Token) string

func (*DetectorImpl) Tokenize

func (fp *DetectorImpl) Tokenize(input string) ([]Token, error)

type Option

type Option func(*DetectorImpl)

func WithDetectionStats added in v0.5.6

func WithDetectionStats(stats telemetry.DeferrableCounter[int64]) Option

func WithPIITypes added in v0.5.0

func WithPIITypes(types ...PIIType) Option

func WithRedactedReplacement added in v0.5.0

func WithRedactedReplacement(replacement string) Option

func WithRedactionStats added in v0.5.6

func WithRedactionStats(stats telemetry.DeferrableCounter[int64]) Option

type PIIType added in v0.5.0

type PIIType int

func (PIIType) String added in v0.5.6

func (t PIIType) String() string

type Token

type Token struct {
	Type  PIIType
	Value string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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