feat: v0.4.0 simplify

This commit is contained in:
2025-09-23 23:14:13 +03:00
parent 214fda877e
commit fc3678f758
6 changed files with 198 additions and 174 deletions

View File

@@ -5,30 +5,11 @@ import (
"time"
)
type Status uint8
const (
StatusUnknown Status = iota
StatusOK
StatusDown
)
func (s Status) String() string {
switch s {
case StatusOK:
return "OK"
case StatusDown:
return "DOWN"
default:
return "UNKNOWN"
}
}
// CheckFunc is a function that does the actual work.
// This package provides a number of check functions but
// any function matching the signature may be provided.
// It must obey context dealine and cancellation.
type CheckFunc func(context.Context) (Status, error)
type CheckFunc func(context.Context) error
// Check represents a check that must be run by Watchdog.
type Check struct {
@@ -38,7 +19,6 @@ type Check struct {
}
type CheckResult struct {
Name string // identifier of check
Status Status // status as retuned by CheckFunc
Error error // error returned by CheckFunc
Name string // identifier of check
Error error // error returned by CheckFunc
}