Migrate to checker-sdk-go v1.3.0 with new server subpackage
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.
This commit is contained in:
parent
6a82601ae8
commit
a9a704c0ff
4 changed files with 8 additions and 8 deletions
|
|
@ -71,7 +71,7 @@ var zonemasterHTMLTemplate = template.Must(
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Zonemaster{{if .Domain}} — {{.Domain}}{{end}}</title>
|
||||
<title>Zonemaster{{if .Domain}}, {{.Domain}}{{end}}</title>
|
||||
<style>
|
||||
*, *::before, *::after { box-sizing: border-box; }
|
||||
:root {
|
||||
|
|
@ -157,7 +157,7 @@ details[open] > summary::before { transform: rotate(90deg); }
|
|||
<body>
|
||||
|
||||
<div class="hd">
|
||||
<h1>Zonemaster{{if .Domain}} — <code>{{.Domain}}</code>{{end}}</h1>
|
||||
<h1>Zonemaster{{if .Domain}}, <code>{{.Domain}}</code>{{end}}</h1>
|
||||
<div class="meta">
|
||||
{{- if .CreatedAt}}Run at {{.CreatedAt}}{{end -}}
|
||||
{{- if and .CreatedAt .HashID}} · {{end -}}
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -2,4 +2,4 @@ module git.happydns.org/checker-zonemaster
|
|||
|
||||
go 1.25.0
|
||||
|
||||
require git.happydns.org/checker-sdk-go v1.2.0
|
||||
require git.happydns.org/checker-sdk-go v1.3.0
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -1,2 +1,2 @@
|
|||
git.happydns.org/checker-sdk-go v1.2.0 h1:v4MpKAz0W3PwP+bxx3pya8w893sVH5xTD1of1cc0TV8=
|
||||
git.happydns.org/checker-sdk-go v1.2.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=
|
||||
git.happydns.org/checker-sdk-go v1.3.0 h1:FG2kIhlJCzI0m35EhxSgn4UWc9M4ha6aZTeoChu4l7A=
|
||||
git.happydns.org/checker-sdk-go v1.3.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=
|
||||
|
|
|
|||
6
main.go
6
main.go
|
|
@ -4,8 +4,8 @@ import (
|
|||
"flag"
|
||||
"log"
|
||||
|
||||
"git.happydns.org/checker-sdk-go/checker/server"
|
||||
zonemaster "git.happydns.org/checker-zonemaster/checker"
|
||||
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||
)
|
||||
|
||||
// Version is the standalone binary's version. It defaults to "custom-build"
|
||||
|
|
@ -23,8 +23,8 @@ func main() {
|
|||
// CheckerDefinition.Version.
|
||||
zonemaster.Version = Version
|
||||
|
||||
server := sdk.NewServer(zonemaster.Provider())
|
||||
if err := server.ListenAndServe(*listenAddr); err != nil {
|
||||
srv := server.New(zonemaster.Provider())
|
||||
if err := srv.ListenAndServe(*listenAddr); err != nil {
|
||||
log.Fatalf("server error: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue