mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Fix main startup (#232)
Set version and name of the program. And then call coremain.Run(). The coremain split makes CoreDNS embeddable. Also see #189 for an old PR.
This commit is contained in:
28
coredns.go
28
coredns.go
@@ -1,31 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
"github.com/mholt/caddy/caddy/caddymain"
|
||||
)
|
||||
|
||||
//go:generate go run plugin_generate.go
|
||||
import "github.com/miekg/coredns/coremain"
|
||||
|
||||
func main() {
|
||||
setFlag()
|
||||
setName()
|
||||
|
||||
caddymain.Run()
|
||||
coremain.Run()
|
||||
}
|
||||
|
||||
// setFlag sets flags to predefined values for CoreDNS.
|
||||
func setFlag() {
|
||||
flag.Set("type", "dns")
|
||||
}
|
||||
|
||||
// setName sets application name and versioning information for CoreDNS.
|
||||
func setName() {
|
||||
caddy.DefaultConfigFile = "Corefile"
|
||||
caddy.AppName = "CoreDNS"
|
||||
caddy.AppVersion = version
|
||||
}
|
||||
|
||||
const version = "001"
|
||||
|
||||
Reference in New Issue
Block a user