35 lines
559 B
Go
35 lines
559 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"runtime"
|
|
)
|
|
|
|
const (
|
|
appName = "powerdns-remote-http-example"
|
|
appVersion = "0.0.1"
|
|
|
|
userAgent = appName + "/" + appVersion
|
|
|
|
minimumGoMaxProcs = 4
|
|
)
|
|
|
|
func main() {
|
|
gmp := runtime.GOMAXPROCS(0)
|
|
if gmp < minimumGoMaxProcs {
|
|
runtime.GOMAXPROCS(minimumGoMaxProcs)
|
|
}
|
|
|
|
log.SetFlags(log.Flags() | log.Lmicroseconds)
|
|
log.Printf("%s: starting\n", userAgent)
|
|
|
|
setupNftables()
|
|
r := setupGin()
|
|
setupAddrMapHousekeeping()
|
|
log.Printf("%s: ready\n", userAgent)
|
|
|
|
if err := r.Run(cfgListen); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|