53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
package checker
|
|
|
|
import (
|
|
"time"
|
|
|
|
sdk "git.happydns.org/checker-sdk-go/checker"
|
|
)
|
|
|
|
// Version is overridden at build time via -ldflags by main.go and plugin.go.
|
|
var Version = "built-in"
|
|
|
|
// Definition exposes the checker to the happyDomain host.
|
|
//
|
|
// The checker is zone-scoped: it walks every service in the working zone in
|
|
// a single pass, which lets the report show one consolidated picture
|
|
// instead of one observation per service.
|
|
func Definition() *sdk.CheckerDefinition {
|
|
def := &sdk.CheckerDefinition{
|
|
ID: "legacy-records",
|
|
Name: "Legacy DNS record types",
|
|
Version: Version,
|
|
Availability: sdk.CheckerAvailability{
|
|
ApplyToZone: true,
|
|
},
|
|
ObservationKeys: []sdk.ObservationKey{ObservationKeyLegacy},
|
|
Options: sdk.CheckerOptionsDocumentation{
|
|
DomainOpts: []sdk.CheckerOptionDocumentation{
|
|
{
|
|
Id: "domain_name",
|
|
Label: "Domain name",
|
|
AutoFill: sdk.AutoFillDomainName,
|
|
},
|
|
{
|
|
Id: "zone",
|
|
Label: "Zone",
|
|
AutoFill: sdk.AutoFillZone,
|
|
Hide: true,
|
|
},
|
|
},
|
|
},
|
|
Rules: []sdk.CheckRule{
|
|
&legacyRecordsRule{},
|
|
},
|
|
HasHTMLReport: true,
|
|
Interval: &sdk.CheckIntervalSpec{
|
|
Min: 5 * time.Minute,
|
|
Max: 24 * time.Hour,
|
|
Default: 6 * time.Hour,
|
|
},
|
|
}
|
|
def.BuildRulesInfo()
|
|
return def
|
|
}
|