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:
parent
bed251bb7f
commit
e7ea37bcf2
6 changed files with 13 additions and 11 deletions
|
|
@ -1,3 +1,5 @@
|
|||
//go:build standalone
|
||||
|
||||
package checker
|
||||
|
||||
import (
|
||||
|
|
@ -10,7 +12,7 @@ import (
|
|||
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||
)
|
||||
|
||||
// RenderForm implements sdk.CheckerInteractive.
|
||||
// RenderForm implements server.Interactive.
|
||||
func (p *xmppProvider) RenderForm() []sdk.CheckerOptionField {
|
||||
return []sdk.CheckerOptionField{
|
||||
{
|
||||
|
|
@ -36,7 +38,7 @@ func (p *xmppProvider) RenderForm() []sdk.CheckerOptionField {
|
|||
}
|
||||
}
|
||||
|
||||
// ParseForm implements sdk.CheckerInteractive.
|
||||
// ParseForm implements server.Interactive.
|
||||
func (p *xmppProvider) ParseForm(r *http.Request) (sdk.CheckerOptions, error) {
|
||||
domain := strings.TrimSpace(r.FormValue("domain"))
|
||||
domain = strings.TrimSuffix(domain, ".")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue