Initial commit
This commit is contained in:
commit
66cf1fc9aa
30 changed files with 2735 additions and 0 deletions
54
checker/definition.go
Normal file
54
checker/definition.go
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
package checker
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||
)
|
||||
|
||||
// Version is overridden at link time by the standalone or plugin entrypoints.
|
||||
var Version = "built-in"
|
||||
|
||||
// Definition assembles the checker definition by aggregating each
|
||||
// registered Source's options into the SDK's audience-grouped layout.
|
||||
// Adding a source automatically adds its option fields here: no edit
|
||||
// to this file needed.
|
||||
func Definition() *sdk.CheckerDefinition {
|
||||
opts := sdk.CheckerOptionsDocumentation{
|
||||
DomainOpts: []sdk.CheckerOptionDocumentation{
|
||||
{
|
||||
Id: "domain_name",
|
||||
Label: "Domain name",
|
||||
AutoFill: sdk.AutoFillDomainName,
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, s := range Sources() {
|
||||
o := s.Options()
|
||||
opts.AdminOpts = append(opts.AdminOpts, o.Admin...)
|
||||
opts.UserOpts = append(opts.UserOpts, o.User...)
|
||||
}
|
||||
|
||||
return &sdk.CheckerDefinition{
|
||||
ID: "blacklist",
|
||||
Name: "Blacklist & reputation",
|
||||
Version: Version,
|
||||
|
||||
Availability: sdk.CheckerAvailability{
|
||||
ApplyToDomain: true,
|
||||
},
|
||||
ObservationKeys: []sdk.ObservationKey{ObservationKeyBlacklist},
|
||||
|
||||
Options: opts,
|
||||
Rules: Rules(),
|
||||
|
||||
Interval: &sdk.CheckIntervalSpec{
|
||||
Min: 30 * time.Minute,
|
||||
Max: 24 * time.Hour,
|
||||
Default: 6 * time.Hour,
|
||||
},
|
||||
|
||||
HasHTMLReport: true,
|
||||
HasMetrics: true,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue