2022-04-28 16:35:02 +00:00
|
|
|
package check
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"errors"
|
|
|
|
|
2022-08-02 18:45:09 +00:00
|
|
|
"code.1533b4dc0.de/prskr/nurse/config"
|
|
|
|
"code.1533b4dc0.de/prskr/nurse/grammar"
|
2022-04-28 16:35:02 +00:00
|
|
|
)
|
|
|
|
|
2022-05-08 09:00:22 +00:00
|
|
|
var (
|
|
|
|
ErrNoSuchCheck = errors.New("no such check")
|
|
|
|
ErrConflictingCheck = errors.New("check with same name already registered")
|
2022-06-09 20:12:45 +00:00
|
|
|
ErrNoSuchValidator = errors.New("no such validator")
|
2022-05-08 09:00:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
Unmarshaler interface {
|
|
|
|
UnmarshalCheck(c grammar.Check, lookup config.ServerLookup) error
|
|
|
|
}
|
2022-04-28 16:35:02 +00:00
|
|
|
|
2022-08-07 10:22:21 +00:00
|
|
|
Context interface {
|
|
|
|
context.Context
|
|
|
|
AttemptContext() (context.Context, context.CancelFunc)
|
|
|
|
WithParent(ctx context.Context) Context
|
|
|
|
}
|
|
|
|
|
2022-05-08 09:00:22 +00:00
|
|
|
SystemChecker interface {
|
|
|
|
Unmarshaler
|
2022-08-07 10:22:21 +00:00
|
|
|
Execute(ctx Context) error
|
2022-05-08 09:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CallUnmarshaler interface {
|
|
|
|
UnmarshalCall(c grammar.Call) error
|
|
|
|
}
|
2022-05-13 13:38:19 +00:00
|
|
|
|
|
|
|
CheckerLookup interface {
|
|
|
|
Lookup(c grammar.Check, srvLookup config.ServerLookup) (SystemChecker, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
ModuleLookup interface {
|
|
|
|
Lookup(modName string) (CheckerLookup, error)
|
|
|
|
}
|
2022-05-08 09:00:22 +00:00
|
|
|
)
|