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
e0302bd176
commit
2bd0ae99bd
6 changed files with 16 additions and 11 deletions
6
main.go
6
main.go
|
|
@ -5,7 +5,7 @@ import (
|
|||
"log"
|
||||
|
||||
matrix "git.happydns.org/checker-matrix/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"
|
||||
|
|
@ -23,8 +23,8 @@ func main() {
|
|||
// CheckerDefinition.Version.
|
||||
matrix.Version = Version
|
||||
|
||||
server := sdk.NewServer(matrix.Provider())
|
||||
if err := server.ListenAndServe(*listenAddr); err != nil {
|
||||
srv := server.New(matrix.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