2022-04-28 16:35:02 +00:00
|
|
|
package check
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"errors"
|
|
|
|
|
2022-05-08 09:00:22 +00:00
|
|
|
"github.com/baez90/nurse/config"
|
2022-04-28 16:35:02 +00:00
|
|
|
"github.com/baez90/nurse/grammar"
|
|
|
|
)
|
|
|
|
|
2022-05-08 09:00:22 +00:00
|
|
|
var (
|
|
|
|
ErrNoSuchCheck = errors.New("no such check")
|
|
|
|
ErrConflictingCheck = errors.New("check with same name already registered")
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
Unmarshaler interface {
|
|
|
|
UnmarshalCheck(c grammar.Check, lookup config.ServerLookup) error
|
|
|
|
}
|
2022-04-28 16:35:02 +00:00
|
|
|
|
2022-05-08 09:00:22 +00:00
|
|
|
SystemChecker interface {
|
|
|
|
Unmarshaler
|
|
|
|
Execute(ctx context.Context) error
|
|
|
|
}
|
|
|
|
|
|
|
|
CallUnmarshaler interface {
|
|
|
|
UnmarshalCall(c grammar.Call) error
|
|
|
|
}
|
|
|
|
)
|