nurse/check/api.go
Peter Kurfer 0faff1d481
Some checks failed
Renovate / renovate (push) Successful in 1m8s
Go build / build (push) Failing after 2m3s
chore: cleanup, add docs, refactor some quirks and prepare release
2023-12-04 16:59:10 +01:00

46 lines
905 B
Go

package check
import (
"context"
"errors"
"time"
"code.icb4dc0.de/prskr/nurse/config"
"code.icb4dc0.de/prskr/nurse/grammar"
)
var (
ErrNoSuchCheck = errors.New("no such check")
ErrConflictingCheck = errors.New("check with same name already registered")
ErrNoSuchValidator = errors.New("no such validator")
)
type (
Unmarshaler interface {
UnmarshalCheck(c grammar.Check, lookup config.ServerLookup) error
}
Context interface {
context.Context
AttemptCount() uint
AttemptTimeout() time.Duration
WithParent(ctx context.Context) Context
}
SystemChecker interface {
Unmarshaler
Execute(ctx Context) error
}
CallUnmarshaler interface {
UnmarshalCall(c grammar.Call) error
}
CheckerLookup interface {
Lookup(c grammar.Check, srvLookup config.ServerLookup) (SystemChecker, error)
}
ModuleLookup interface {
Lookup(modName string) (CheckerLookup, error)
}
)