Documentation
¶
Index ¶
- type Engine
- func (e *Engine) AddBuiltin(name string) error
- func (e *Engine) AddExclude(pattern string)
- func (e *Engine) AddKeyword(keyword, category string)
- func (e *Engine) AddRegex(pattern, category string) error
- func (e *Engine) Redact(input []byte) ([]byte, int)
- func (e *Engine) RedactWithMatches(input []byte) ([]byte, []Match)
- type Match
- type Redactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine handles sensitive data detection and replacement
func (*Engine) AddBuiltin ¶
AddBuiltin adds a built-in rule to the engine (typically driven by config patterns.builtin).
func (*Engine) AddExclude ¶
AddExclude adds an exclude pattern
func (*Engine) AddKeyword ¶
AddKeyword adds a keyword pattern
func (*Engine) RedactWithMatches ¶
RedactWithMatches scans and redacts sensitive data, returning detailed match information for this run. Note: matches.Original contains the original hit content; callers that display it in the admin UI must apply privacy settings (redaction/truncation).
type Match ¶
type Match struct {
Start int
End int
Original string
Category string
// Placeholder is the generated placeholder (e.g. "__VG_EMAIL_...").
// It is only generated during replacement; used for audit/inspection displays that need to show redaction hits.
Placeholder string
}
Match represents a detected sensitive data match
Click to show internal directories.
Click to hide internal directories.