feat: publish standalone worker

Separate worker packaging and service lifecycle from the control plane.
Этот коммит содержится в:
Gleb Tv
2026-07-13 17:55:14 +03:00
Коммит 2c7a0236da
309 изменённых файлов: 44004 добавлений и 0 удалений

38
internal/checkresult/result.go Обычный файл
Просмотреть файл

@@ -0,0 +1,38 @@
// Package checkresult holds the DB-free outcome of a single check execution.
package checkresult
import (
"time"
)
// CheckResult is the in-memory outcome of a single check execution.
// The check packages build a CheckResult, then call SaveTo to persist
// state, error, warnings, infos, and expiry back to the check row.
type CheckResult struct {
State string
Error error
Warnings []string
Infos []string
Duration time.Duration
Expires *time.Time
}
// GetState returns the result state (OK/ERR/FAIL/WARN).
func (r *CheckResult) GetState() string {
return r.State
}
// GetError returns the result error, if any.
func (r *CheckResult) GetError() error {
return r.Error
}
// GetWarnings returns the human-readable warnings produced by the check.
func (r *CheckResult) GetWarnings() []string {
return r.Warnings
}
// GetInfos returns the human-readable info messages produced by the check.
func (r *CheckResult) GetInfos() []string {
return r.Infos
}