Documentation
¶
Overview ¶
Package drill holds the drill file format and its validation.
Index ¶
- func HasErrors(issues []Issue) bool
- func Hash(data []byte) string
- func Load(file string, data []byte) (*Drill, []Issue)
- func LoadDir(dir string) ([]*Drill, []Issue, error)
- func Parse(file string, data []byte) (*Drill, []Issue)
- func UsedPaths(d *Drill) map[string][]string
- func VersionAtLeast(v, min string) bool
- type Condition
- type Drill
- type Evaluator
- type Fetch
- type Issue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse reads one drill file. Every structural problem is returned as an Issue with its line, so a broken file reports all it can in one pass.
func VersionAtLeast ¶
VersionAtLeast reports whether version v is at least min. Both are x.y.z, with an optional leading v and any suffix after the patch number ignored.
Types ¶
type Drill ¶
type Drill struct {
Firedrill string
ID string
Safeguard string
Source string
Owner string
Severity string
ForEach string
Fetches []Fetch
AppliesWhen *Condition
NAReason string
PassWhen []Condition
WarnWhen []Condition
Fix string
MapsTo []string
Author string // who wrote it, for hub drills
Requires string // the oldest Firedrill it runs on, as ">= x.y.z"
File string
Hash string
}
Drill is one parsed drill file.
func (*Drill) MinVersion ¶
MinVersion returns the version a requires field names, or "" when absent.
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator evaluates one drill's conditions over fact data.
func NewEvaluator ¶
NewEvaluator returns an Evaluator for a drill.