(ips []string, config string)
| 11 | ) |
| 12 | |
| 13 | func 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 | |
| 30 | func parseStatic(ips []string, config string) (*ipdns.Static, []FutureLog) { |
| 31 | var static ipdns.Static |
no test coverage detected