Migrate to checker-sdk-go v1.3.0 with standalone build tag

The SDK split the HTTP server scaffolding into the new
checker-sdk-go/checker/server subpackage. Update main.go to import
server and call server.New, and isolate the interactive form code
behind the standalone build tag so plugin/builtin builds skip
net/http entirely.
This commit is contained in:
nemunaire 2026-04-24 13:02:42 +07:00
commit 2128064abf
7 changed files with 18 additions and 13 deletions

View file

@ -63,7 +63,7 @@ func (p *nsProvider) Collect(ctx context.Context, opts sdk.CheckerOptions) (any,
// serviceFromOptions extracts a *serviceMessage from the options. It accepts
// either a direct value (in-process plugin path) or a JSON-decoded
// map[string]any (HTTP path) both are normalized via a JSON round-trip.
// map[string]any (HTTP path), both are normalized via a JSON round-trip.
func serviceFromOptions(opts sdk.CheckerOptions) (*serviceMessage, error) {
v, ok := opts["service"]
if !ok {

View file

@ -1,3 +1,5 @@
//go:build standalone
package checker
import (
@ -11,7 +13,7 @@ import (
"github.com/miekg/dns"
)
// RenderForm implements sdk.CheckerInteractive. It lists the minimal human
// RenderForm implements server.Interactive. It lists the minimal human
// inputs needed to bootstrap a check when this checker runs standalone
// (outside of a happyDomain host).
func (p *nsProvider) RenderForm() []sdk.CheckerOptionField {
@ -27,9 +29,9 @@ func (p *nsProvider) RenderForm() []sdk.CheckerOptionField {
}
}
// ParseForm implements sdk.CheckerInteractive. It resolves the NS records
// ParseForm implements server.Interactive. It resolves the NS records
// for the requested domain via DNS and assembles the CheckerOptions that
// Collect expects replacing the AutoFill work that happyDomain would
// Collect expects, replacing the AutoFill work that happyDomain would
// otherwise perform.
func (p *nsProvider) ParseForm(r *http.Request) (sdk.CheckerOptions, error) {
domain := strings.TrimSpace(r.FormValue("domain"))