MCPcopy Index your code
hub / github.com/screego/server / applyIPTo

Function applyIPTo

config/ip.go:58–71  ·  view source on GitHub ↗
(config, ip string, static *ipdns.Static)

Source from the content-addressed store, hash-verified

56}
57
58func applyIPTo(config, ip string, static *ipdns.Static) (bool, []FutureLog) {
59 parsed := net.ParseIP(ip)
60 if parsed == nil || ip == "0.0.0.0" {
61 return false, []FutureLog{futureFatal(fmt.Sprintf("invalid %s: %s", config, ip))}
62 }
63
64 v4 := parsed.To4() != nil
65 if v4 {
66 static.V4 = parsed
67 } else {
68 static.V6 = parsed
69 }
70 return v4, nil
71}
72
73func parseDNS(dnsString string) *ipdns.DNS {
74 var dns ipdns.DNS

Callers 1

parseStaticFunction · 0.85

Calls 1

futureFatalFunction · 0.85

Tested by

no test coverage detected