Documentation
¶
Index ¶
Constants ¶
const (
EOLCollector = "endoflife.date"
)
Variables ¶
var (
ErrEOLComponenetTypeMismatch = errors.New("rootComponent type is not []*root_package.PackageNode")
)
Functions ¶
func EvaluateEOLResponse ¶
func NewEOLCertifier ¶
Types ¶
type CycleData ¶
type CycleData struct {
Cycle string `json:"cycle"`
ReleaseDate string `json:"releaseDate"`
EOL EOLStringOrBool `json:"eol"` // Can be string or boolean
Latest string `json:"latest"`
Link *string `json:"link"` // Can be null
LTS EOLStringOrBool `json:"lts"` // Can be string or boolean
Support EOLStringOrBool `json:"support"` // Can be string or boolean
Discontinued EOLStringOrBool `json:"discontinued"` // Can be string or boolean
}
CycleData represents the endoflife.date API data type for a cycle
type EOLData ¶
type EOLData = []CycleData
EOLData is a list of CycleData, the response from the endoflife.date API
type EOLStringOrBool ¶
type EOLStringOrBool struct {
// contains filtered or unexported fields
}
EOLStringOrBool represents a value that can be either a string, boolean, or null
func NewBoolValue ¶
func NewBoolValue(b bool) EOLStringOrBool
NewBoolValue creates a EOLStringOrBool from a bool
func NewStringValue ¶
func NewStringValue(s string) EOLStringOrBool
NewStringValue creates a EOLStringOrBool from a string
func (*EOLStringOrBool) Bool ¶
func (f *EOLStringOrBool) Bool() bool
Bool returns a boolean value: - If value is bool: returns that value - If value is string: tries to parse as date and compares with current time - Otherwise: returns false
func (*EOLStringOrBool) IsBool ¶
func (f *EOLStringOrBool) IsBool() bool
IsBool returns true if the value is a boolean
func (*EOLStringOrBool) IsString ¶
func (f *EOLStringOrBool) IsString() bool
IsString returns true if the value is a string
func (*EOLStringOrBool) String ¶
func (f *EOLStringOrBool) String() string
String returns the string value or empty string if not a string
func (*EOLStringOrBool) ToBool ¶
func (f *EOLStringOrBool) ToBool() bool
ToBool converts the value to a boolean based on type: - bool: returns the value - string: returns true if non-empty - nil: returns false
func (*EOLStringOrBool) UnmarshalJSON ¶
func (f *EOLStringOrBool) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler