Documentation
¶
Index ¶
- func IsTextFile(path string) bool
- func MaskAll(content string) string
- func MaskSecretKeyBlocks(content string) string
- type RuleSet
- func (r *RuleSet) AddAllowed(pattern string) error
- func (r *RuleSet) AddPattern(pattern string) error
- func (r *RuleSet) AddValueMaskKey(keywordList []string)
- func (r *RuleSet) ScanDir(root string, recursive bool) ([]SecretMatch, error)
- func (r *RuleSet) ScanFile(path string) ([]SecretMatch, error)
- func (r *RuleSet) ScanReader(rd io.Reader, filename string) ([]SecretMatch, error)
- type SecretMatch
- type ValueMaskRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTextFile ¶
func MaskSecretKeyBlocks ¶
Types ¶
type RuleSet ¶
type RuleSet struct {
FullMaskPatterns []*regexp.Regexp // Default+Added patterns (order matters!)
Allowed []*regexp.Regexp
ValueMaskRules []*ValueMaskRule
}
func DefaultRuleSet ¶
func DefaultRuleSet() *RuleSet
func (*RuleSet) AddAllowed ¶
func (*RuleSet) AddPattern ¶
func (*RuleSet) AddValueMaskKey ¶ added in v1.1.5
func (*RuleSet) ScanDir ¶
func (r *RuleSet) ScanDir(root string, recursive bool) ([]SecretMatch, error)
func (*RuleSet) ScanReader ¶
type ValueMaskRule ¶ added in v1.1.5
func (*ValueMaskRule) MaskLine ¶ added in v1.1.5
func (r *ValueMaskRule) MaskLine(line string) string
Click to show internal directories.
Click to hide internal directories.