feat: publish standalone worker
Separate worker packaging and service lifecycle from the control plane.
Этот коммит содержится в:
38
internal/checkresult/result.go
Обычный файл
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
|
||||
}
|
||||
Ссылка в новой задаче
Block a user