Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNotTextFileError ¶
Types ¶
type DetectedSecret ¶
type DetectedSecret struct {
// Type is the type of the detector that detected the secret
Type string
// Key is the key of the detected secret.
// Key can be empty if a secret was detected without one.
Key string
// Value is the value of the detected secret
Value string
}
DetectedSecret represents a secret detected by the engine.
type Detector ¶
type Detector interface {
// Scan scans secrets from the given string.
// Input structure is unexpected, and may contain multiple secrets.
Scan(in string) ([]DetectedSecret, error)
// ScanMap scans secrets from the given key-value pairs.
ScanMap(keyValueMap map[string]string) ([]DetectedSecret, error)
// SecretType returns a human-readable string that describes the type of secret that is detected by this Detector.
// This string should be returned as DetectedSecret.Type when detecting a secret.
SecretType() string
}
type DetectorFactory ¶
type DetectorFactory interface {
Register(name string, initMethod func(config ...string) Detector) error
Create(names []string, detectorConfigs map[string][]string) (detectors []Detector, missing []string)
}
func GetDetectorFactory ¶
func GetDetectorFactory() DetectorFactory
type NotTextFileError ¶
type NotTextFileError struct {
// contains filtered or unexported fields
}
func (*NotTextFileError) Error ¶
func (err *NotTextFileError) Error() string
type Scanner ¶
type Scanner interface {
ScanFile(path string) ([]DetectedSecret, error)
ScanFileReader(in io.Reader, path string, size int64) ([]DetectedSecret, error)
ScanWithFormat(in io.Reader, format dataformat.DataFormat) ([]DetectedSecret, error)
ScanStringWithFormat(inStr string, format dataformat.DataFormat) ([]DetectedSecret, error)
ScanReader(in io.Reader) ([]DetectedSecret, error)
Scan(in string) ([]DetectedSecret, error)
}
type Transformer ¶
type Transformer interface {
Transform(in string) (map[string]string, bool)
SupportedFormats() []dataformat.DataFormat
SupportFiles() bool
}
type TransformerFactory ¶
type TransformerFactory interface {
Register(name string, initMethod func() Transformer) error
Create(names []string) (transformers []Transformer, missing []string)
}
func GetTransformerFactory ¶
func GetTransformerFactory() TransformerFactory
Click to show internal directories.
Click to hide internal directories.