Files
navigator/mapping/map.go
Yifu Yu fbc2301287 Release v0.1.0: now with starlark script support.
You may send SIGHUP signal to the process to make it reread the script.
It will use older loaded version if parsing of new file failed.
2019-11-17 03:52:34 +08:00

25 lines
389 B
Go

package mapping
import (
"flag"
"git.eve.moe/jackyyf/navigator/mapping/elf"
)
var (
defaultServer = flag.String("fallback-node",
"xe-mci1-us.edge.eve.network",
"Default CDN node in case of any error when executing script")
)
func Initialize() {
elf.Initialize()
}
func Get(ip string) string {
ret := elf.GetMapping(ip)
if ret == "" {
return *defaultServer
}
return ret
}