add yaml/json annotations for redaction reports

This commit is contained in:
Andrew Lavery
2020-05-20 14:58:37 -04:00
parent 5a2c153026
commit 0d84c62c78

View File

@@ -35,15 +35,15 @@ type Redactor interface {
// Redactions are indexed both by the file affected and by the name of the redactor
type RedactionList struct {
ByRedactor map[string][]Redaction
ByFile map[string][]Redaction
ByRedactor map[string][]Redaction `json:"byRedactor" yaml:"byRedactor"`
ByFile map[string][]Redaction `json:"byFile" yaml:"byFile"`
}
type Redaction struct {
RedactorName string
CharactersRemoved int
Line int
File string
RedactorName string `json:"redactorName" yaml:"redactorName"`
CharactersRemoved int `json:"charactersRemoved" yaml:"charactersRemoved"`
Line int `json:"line" yaml:"line"`
File string `json:"file" yaml:"file"`
}
func Redact(input []byte, path string, additionalRedactors []*troubleshootv1beta1.Redact) ([]byte, error) {