Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Detectors []*Detector
}
Config is the format of the configuration files
func Parse ¶
Parse parses the detector config from the given io.Reader.
Due to current internal limitations, the entire contents of the io.Reader will be copied into memory first before parsing.
func ParseDir ¶
ParseDir parses all the files ending in ".hcl" in a directory, sorted alphabetically.
type Detector ¶
type Detector struct { // Type is the type that will match if this detector matches Type string // File is a list of file globs to look for. If any are found, it is // a match. File []string // Contents is a content matcher. The key is a filename and the // path is the file contents regular expression. Contents map[string]string // Priority is used to break ties when two detectors conflict. // The detector with the higher (larger number) priority wins. // This defaults to 0. Negative numbers can be used to lower // priority and positive numbers can be used to increase it. // // In most cases, a priority never needs to be set. Please set this // with care. Priority int }
Detector is something that detects a single type.
type DetectorList ¶ added in v0.2.0
type DetectorList []*Detector
DetectorList is a sortable slice of Detectors, and implements sort.Interface.
func (DetectorList) Len ¶ added in v0.2.0
func (l DetectorList) Len() int
func (DetectorList) Less ¶ added in v0.2.0
func (l DetectorList) Less(i, j int) bool
func (DetectorList) Swap ¶ added in v0.2.0
func (l DetectorList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.