Categorygithub.com/yonesko/jsonredact
modulepackage
1.0.1
Repository: https://github.com/yonesko/jsonredact.git
Documentation: pkg.go.dev

# README

JSONRedact redacts sensitive fields from JSON

//User '.' as separator of objects and arrays.
//Use '#' as wildcard for any key or array index.
//Use '*' to apply right expression to all object keys recursively.
//User '\' to escape control symbols above.

redactor := NewRedactor([]string{`a.b`, `c`}, func(s string) string {
		return "REDACTED"
	}

redactedJson := redactor.Redact(`{"a":{"b":"secret", "c":"Jack"}, "c":"secret"}`)
//{"a":{"b":"REDACTED", "c":"Jack"}, "c":"REDACTED"}
  • Production tested
  • Don't waste your cpu and mem

# Functions

User '.' as separator of objects and arrays.
No description provided by the author

# Structs

No description provided by the author