Redact 使用所有脱敏器进行脱敏
(text string)
| 209 | |
| 210 | // Redact 使用所有脱敏器进行脱敏 |
| 211 | func (c *CompositeRedactor) Redact(text string) string { |
| 212 | result := text |
| 213 | for _, redactor := range c.redactors { |
| 214 | result = redactor.Redact(result) |
| 215 | } |
| 216 | return result |
| 217 | } |
| 218 | |
| 219 | // AddRedactor 添加脱敏器 |
| 220 | func (c *CompositeRedactor) AddRedactor(redactor ContentRedactor) { |