Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HighestUserWastedPercent ¶
type HighestUserWastedPercent struct {
Threshold float64
}
HighestUserWastedPercent fails if wasted bytes as a fraction of total size exceed the threshold.
func (HighestUserWastedPercent) Evaluate ¶
func (r HighestUserWastedPercent) Evaluate(result *image.EfficiencyResult, totalSize int64) RuleResult
func (HighestUserWastedPercent) Name ¶
func (r HighestUserWastedPercent) Name() string
type HighestWastedBytes ¶
type HighestWastedBytes struct {
Threshold int64
}
HighestWastedBytes fails if wasted bytes exceed the threshold. A threshold of 0 disables this rule (always passes).
func (HighestWastedBytes) Evaluate ¶
func (r HighestWastedBytes) Evaluate(result *image.EfficiencyResult, _ int64) RuleResult
func (HighestWastedBytes) Name ¶
func (r HighestWastedBytes) Name() string
type LowestEfficiency ¶
type LowestEfficiency struct {
Threshold float64
}
LowestEfficiency fails if the efficiency score is below the threshold.
func (LowestEfficiency) Evaluate ¶
func (r LowestEfficiency) Evaluate(result *image.EfficiencyResult, _ int64) RuleResult
func (LowestEfficiency) Name ¶
func (r LowestEfficiency) Name() string
type Report ¶
type Report struct {
Passed bool
Results []RuleResult
TopWaste []image.WastedFile
Score float64
}
Report holds the results of all rule evaluations.
func Evaluate ¶
func Evaluate(efficiency *image.EfficiencyResult, totalSize int64, rules []Rule) *Report
Evaluate runs all rules against the efficiency result and returns a report.
type Rule ¶
type Rule interface {
Name() string
Evaluate(result *image.EfficiencyResult, totalSize int64) RuleResult
}
Rule evaluates one aspect of image efficiency.
Click to show internal directories.
Click to hide internal directories.