nurse/check/api.go
Peter Kurfer c52912c5aa
Some checks failed
agola/nurse/Test and lint The run failed
refactor: migrate to new Gitea URL
2022-09-22 11:46:36 +02:00

44 lines
899 B
Go

package check
import (
"context"
"errors"
"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
AttemptContext() (context.Context, context.CancelFunc)
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)
}
)