initial commit
This commit is contained in:
35
main.go
Normal file
35
main.go
Normal file
@@ -0,0 +1,35 @@
|
||||
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)
|
||||
|
||||
setupDns()
|
||||
setupAddrMapHousekeeping()
|
||||
setupNftables()
|
||||
r := setupGin()
|
||||
log.Printf("%s: ready\n", userAgent)
|
||||
|
||||
if err := r.Run(cfgListen); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user