Documentation ¶
Index ¶
- Constants
- func GetSoftwaresToCalculate(s *soft.Software, checkDependencies bool) []*soft.Software
- func New(logger *slog.Logger, t soft.CalculatorType, checkDependencies bool) soft.Calculator
- type CandidateCountCalculator
- type DefaultCalculator
- type MetaCalculator
- type ReleaseDateCalculator
- type SkipCalculator
Constants ¶
const DefaultPerCandidateScore = 30
Variables ¶
This section is empty.
Functions ¶
func GetSoftwaresToCalculate ¶
Returns a list of softwares to compute a score for. If checkDependencies is true, include dependency softwares with a depth of 1 in the dependency tree
func New ¶
func New(logger *slog.Logger, t soft.CalculatorType, checkDependencies bool) soft.Calculator
Provides a based on input type. Falls back on DefaultCalculator
NOTE: Should DefaultCalculator be renamed to SemverCalculator and MetaCalculator be renamed to DefaultCalculator?
Types ¶
type CandidateCountCalculator ¶
type CandidateCountCalculator struct {
// contains filtered or unexported fields
}
func (*CandidateCountCalculator) CalculateObsolescenceScore ¶
func (c *CandidateCountCalculator) CalculateObsolescenceScore(s *soft.Software) error
type DefaultCalculator ¶
type DefaultCalculator struct {
// contains filtered or unexported fields
}
The default calculator parses versions using Semantic Versioning. It takes the last version available and computes the obsolescence score:
x major versions late = x * 50
y minor versions late = y * 5
z patch versions late = z * 1
func (*DefaultCalculator) CalculateObsolescenceScore ¶
func (c *DefaultCalculator) CalculateObsolescenceScore(s *soft.Software) error
Compute Obsolescence score by comparing current and last version and computes the obsolescence score
x major versions late = m * 50
y minor versions late = y * 5
z patch versions late = z * 1
type MetaCalculator ¶
type MetaCalculator struct {
// contains filtered or unexported fields
}
func (*MetaCalculator) CalculateObsolescenceScore ¶
func (c *MetaCalculator) CalculateObsolescenceScore(s *software.Software) error
Entrypoint calculator which supports softwares with dependencies having different Calculator Types
type ReleaseDateCalculator ¶
type ReleaseDateCalculator struct {
// contains filtered or unexported fields
}
func (*ReleaseDateCalculator) CalculateObsolescenceScore ¶
func (c *ReleaseDateCalculator) CalculateObsolescenceScore(s *soft.Software) error
type SkipCalculator ¶
type SkipCalculator struct{}
Accepts the arbitrarily set score by the source
func (*SkipCalculator) CalculateObsolescenceScore ¶
func (c *SkipCalculator) CalculateObsolescenceScore(s *soft.Software) error