MCPcopy Create free account
hub / github.com/barnybug/cli53 / parseComment

Function parseComment

bind.go:17–39  ·  view source on GitHub ↗
(rr dns.RR, comment string)

Source from the content-addressed store, hash-verified

15)
16
17func parseComment(rr dns.RR, comment string) dns.RR {
18 if strings.HasPrefix(comment, "; AWS ") {
19 kvs, err := ParseKeyValues(comment[6:])
20 if err == nil {
21 routing := kvs.GetString("routing")
22 if fn, ok := RoutingTypes[routing]; ok {
23 route := fn()
24 route.Parse(kvs)
25 rr = &AWSRR{
26 rr,
27 route,
28 kvs.GetOptString("healthCheckId"),
29 kvs.GetString("identifier"),
30 }
31 } else {
32 fmt.Printf("Warning: parse AWS extension - routing=\"%s\" not understood\n", routing)
33 }
34 } else {
35 fmt.Printf("Warning: parse AWS extension: %s", err)
36 }
37 }
38 return rr
39}
40
41func parseBindFile(reader io.Reader, filename, origin string) []dns.RR {
42 parser := dns.NewZoneParser(reader, origin, filename)

Callers 2

parseBindFileFunction · 0.85
TestParseCommentFunction · 0.85

Calls 4

ParseKeyValuesFunction · 0.85
GetStringMethod · 0.80
GetOptStringMethod · 0.80
ParseMethod · 0.65

Tested by 1

TestParseCommentFunction · 0.68