25 lines
389 B
Go
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
|
|
}
|