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
52606d6b26
commit
237ef25872
3 changed files with 6 additions and 6 deletions
2
go.mod
2
go.mod
|
|
@ -2,4 +2,4 @@ module git.happydns.org/checker-dummy
|
||||||
|
|
||||||
go 1.25.0
|
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.3.0 h1:FG2kIhlJCzI0m35EhxSgn4UWc9M4ha6aZTeoChu4l7A=
|
||||||
git.happydns.org/checker-sdk-go v1.2.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=
|
git.happydns.org/checker-sdk-go v1.3.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=
|
||||||
|
|
|
||||||
6
main.go
6
main.go
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
dummy "git.happydns.org/checker-dummy/checker"
|
dummy "git.happydns.org/checker-dummy/checker"
|
||||||
sdk "git.happydns.org/checker-sdk-go/checker"
|
"git.happydns.org/checker-sdk-go/checker/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is the standalone binary's version. It defaults to "custom-build"
|
// Version is the standalone binary's version. It defaults to "custom-build"
|
||||||
|
|
@ -23,8 +23,8 @@ func main() {
|
||||||
// CheckerDefinition.Version.
|
// CheckerDefinition.Version.
|
||||||
dummy.Version = Version
|
dummy.Version = Version
|
||||||
|
|
||||||
server := sdk.NewServer(dummy.Provider())
|
srv := server.New(dummy.Provider())
|
||||||
if err := server.ListenAndServe(*listenAddr); err != nil {
|
if err := srv.ListenAndServe(*listenAddr); err != nil {
|
||||||
log.Fatalf("server error: %v", err)
|
log.Fatalf("server error: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue