piidetector

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package piidetector implements pattern-based PII detection and redaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompositePIIDetector

func NewCompositePIIDetector(detectors ...domain.PIIDetector) domain.PIIDetector

NewCompositePIIDetector создаёт композитный детектор из набора под-детекторов.

func NewCreditCardDetector

func NewCreditCardDetector() domain.PIIDetector

NewCreditCardDetector создаёт детектор номеров кредитных карт.

func NewDefaultPIIDetector

func NewDefaultPIIDetector(cats PIICategories) domain.PIIDetector

NewDefaultPIIDetector создаёт CompositePIIDetector из встроенных детекторов согласно включённым категориям.

func NewEmailDetector

func NewEmailDetector() domain.PIIDetector

NewEmailDetector создаёт детектор email-адресов.

func NewPhoneDetector

func NewPhoneDetector() domain.PIIDetector

NewPhoneDetector создаёт детектор телефонных номеров.

func NewSSNDetector

func NewSSNDetector() domain.PIIDetector

NewSSNDetector создаёт детектор SSN (Social Security Number).

Types

type CompositePIIDetector

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

@sk-task pii-guardrails#T1.2: CompositePIIDetector (DEC-002, AC-004)

CompositePIIDetector последовательно применяет набор под-детекторов.

func (*CompositePIIDetector) Detect

func (d *CompositePIIDetector) Detect(text string) string

Detect последовательно применяет все под-детекторы.

type CreditCardDetector

type CreditCardDetector struct{}

@sk-task pii-guardrails#T3.3: CreditCardDetector (RQ-003)

func (*CreditCardDetector) Detect

func (d *CreditCardDetector) Detect(text string) string

Detect заменяет номера кредитных карт на redacted marker.

type EmailDetector

type EmailDetector struct{}

@sk-task pii-guardrails#T1.2: EmailDetector (RQ-003, AC-004)

func (*EmailDetector) Detect

func (d *EmailDetector) Detect(text string) string

Detect заменяет email-адреса на redacted marker.

type PIICategories

type PIICategories struct {
	Email      bool
	Phone      bool
	SSN        bool
	CreditCard bool
}

PIICategories задаёт набор категорий PII для встроенного детектора.

type PhoneDetector

type PhoneDetector struct{}

@sk-task pii-guardrails#T1.2: PhoneDetector (RQ-003, AC-004)

func (*PhoneDetector) Detect

func (d *PhoneDetector) Detect(text string) string

Detect заменяет телефонные номера на redacted marker.

type SSNDetector

type SSNDetector struct{}

@sk-task pii-guardrails#T1.2: SSNDetector (RQ-003, AC-004)

func (*SSNDetector) Detect

func (d *SSNDetector) Detect(text string) string

Detect заменяет SSN на redacted marker.

Jump to

Keyboard shortcuts

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