Documentation
¶
Index ¶
- Constants
- func EffectiveMode(mode string, allowUnredacted bool, unredacted bool) (string, error)
- func IsEnabled(mode string) bool
- func IsValidMode(v string) bool
- func NormalizeMode(v string) string
- func ShouldRedactType(mode, entityType string) bool
- type Engine
- func (e *Engine) Enabled() bool
- func (e *Engine) Mode() string
- func (e *Engine) RedactEmail(email string) string
- func (e *Engine) RedactJSON(data json.RawMessage) (json.RawMessage, error)
- func (e *Engine) RedactPerson(first, last, email string) (string, string, string)
- func (e *Engine) RedactPhone(phone string) string
- func (e *Engine) RedactText(text string, known []KnownIdentity) string
- func (e *Engine) ShouldRedactType(entityType string) bool
- type KnownIdentity
Constants ¶
View Source
const ( ModeOff = "off" ModeCustomers = "customers" ModeAll = "all" )
Variables ¶
This section is empty.
Functions ¶
func EffectiveMode ¶
EffectiveMode applies per-request override policy.
func IsValidMode ¶
func NormalizeMode ¶
NormalizeMode normalizes configured mode values.
func ShouldRedactType ¶
ShouldRedactType decides whether an entity type should be redacted for mode. entityType is expected to be "customer" or "user". Unknown types are only redacted in "all" mode.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) RedactEmail ¶
func (*Engine) RedactJSON ¶
func (e *Engine) RedactJSON(data json.RawMessage) (json.RawMessage, error)
func (*Engine) RedactPerson ¶
func (*Engine) RedactPhone ¶
func (*Engine) RedactText ¶
func (e *Engine) RedactText(text string, known []KnownIdentity) string
RedactText redacts free-form text using known identities followed by regex sweeps.
func (*Engine) ShouldRedactType ¶
Click to show internal directories.
Click to hide internal directories.