checker-xmpp/main.go
Pierre-Olivier Mercier e7ea37bcf2 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.
2026-04-26 16:40:44 +07:00

28 lines
614 B
Go

package main
import (
"flag"
"log"
"git.happydns.org/checker-sdk-go/checker/server"
xmpp "git.happydns.org/checker-xmpp/checker"
)
// Version is the standalone binary's version. It defaults to "custom-build"
// and is meant to be overridden by the CI at link time:
//
// go build -ldflags "-X main.Version=1.2.3" .
var Version = "custom-build"
var listenAddr = flag.String("listen", ":8080", "HTTP listen address")
func main() {
flag.Parse()
xmpp.Version = Version
srv := server.New(xmpp.Provider())
if err := srv.ListenAndServe(*listenAddr); err != nil {
log.Fatalf("server error: %v", err)
}
}