Initial commit

This commit is contained in:
nemunaire 2026-04-27 00:58:19 +07:00
commit d4a59fb9e8
18 changed files with 1439 additions and 0 deletions

53
checker/definition.go Normal file
View file

@ -0,0 +1,53 @@
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
}