Documentation
¶
Overview ¶
Package rule defines rules and their results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterRules ¶
func FilterRules[T Rule](rules []T, filter *TargetFilter) []T
FilterRules returns only rules matching the filter. Returns all rules if filter is nil.
Types ¶
type Applicability ¶
type Applicability struct {
Platform binary.Platform
Compilers map[toolchain.Compiler]CompilerRequirement
}
Applicability defines which platforms and compilers a rule applies to.
type CompilerRequirement ¶
type CompilerRequirement struct {
MinVersion toolchain.Version
DefaultVersion toolchain.Version
Flag string
}
CompilerRequirement specifies version and flag requirements for a compiler.
type CompilerTarget ¶
CompilerTarget specifies a compiler constraint for filtering rules.
type PlatformTarget ¶
type PlatformTarget struct {
Architecture binary.Architecture
MaxISA *binary.ISA
}
PlatformTarget specifies an architecture constraint for filtering rules.
type Rule ¶
type Rule interface {
ID() string
Name() string
Description() string
Applicability() Applicability
}
Rule is a check that can be executed against a binary.
type TargetFilter ¶
type TargetFilter struct {
Platforms []PlatformTarget
Compilers []CompilerTarget
}
TargetFilter selects rules based on platform and compiler constraints.
Click to show internal directories.
Click to hide internal directories.