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

Function parseIPProvider

config/ip.go:13–28  ·  view source on GitHub ↗
(ips []string, config string)

Source from the content-addressed store, hash-verified

11)
12
13func parseIPProvider(ips []string, config string) (ipdns.Provider, []FutureLog) {
14 if len(ips) == 0 {
15 panic("must have at least one ip")
16 }
17
18 first := ips[0]
19 if strings.HasPrefix(first, "dns:") {
20 if len(ips) > 1 {
21 return nil, []FutureLog{futureFatal(fmt.Sprintf("invalid %s: when dns server is specified, only one value is allowed", config))}
22 }
23
24 return parseDNS(strings.TrimPrefix(first, "dns:")), nil
25 }
26
27 return parseStatic(ips, config)
28}
29
30func parseStatic(ips []string, config string) (*ipdns.Static, []FutureLog) {
31 var static ipdns.Static

Callers 1

GetFunction · 0.85

Calls 3

futureFatalFunction · 0.85
parseDNSFunction · 0.85
parseStaticFunction · 0.85

Tested by

no test coverage detected