Documentation
¶
Overview ¶
Package versioncheck fetches upstream release metadata without changing inventory state.
Index ¶
- Variables
- func Compare(current, latest string) (int, bool)
- func SaveAlertSettings(ctx context.Context, db *sql.DB, v AlertSettings) error
- func State(current, latest string, pinned, eol any, now time.Time) string
- func ValidWebhookURL(value string) bool
- func ValidateConfig(cfg Config) error
- type AlertSettings
- type Checker
- type Config
- type Result
- type Summary
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRunning = errors.New("version check already running")
Functions ¶
func Compare ¶
Compare accepts only plain numeric releases. Unknown formats are never called outdated.
func SaveAlertSettings ¶ added in v0.3.0
func ValidWebhookURL ¶ added in v0.3.0
func ValidateConfig ¶ added in v0.3.0
Types ¶
type AlertSettings ¶ added in v0.3.0
type AlertSettings struct {
Enabled bool `json:"enabled"`
WebhookURL string `json:"webhook_url"`
Format string `json:"format"`
}
func GetAlertSettings ¶ added in v0.3.0
type Checker ¶
type Checker struct {
DB *sql.DB
Client *http.Client
GitHubURL, DockerURL, EOLURL string // Test servers may replace the fixed public API origins.
Now func() time.Time
}
func (Checker) DailyAlert ¶ added in v0.3.0
DailyAlert stores one global context per UTC day, then sends at most three attempts per day.
Click to show internal directories.
Click to hide internal directories.