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

Function hasRecord

internal/features/step_definitions.go:423–442  ·  view source on GitHub ↗
(name, record string)

Source from the content-addressed store, hash-verified

421}
422
423func hasRecord(name, record string) bool {
424 r53 := getService()
425 zone := domainZone(name)
426 ctx := context.Background()
427 rrsets, err := cli53.ListAllRecordSets(ctx, r53, *zone.Id)
428 fatalIfErr(err)
429
430 for _, rrset := range rrsets {
431 rrs := cli53.ConvertRRSetToBind(rrset)
432 cli53.UnexpandSelfAliases(rrs, zone, false)
433 for _, rr := range rrs {
434 line := rr.String()
435 line = strings.Replace(line, "\t", " ", -1)
436 if record == line {
437 return true
438 }
439 }
440 }
441 return false
442}
443
444func prepareZoneFile(b []byte, includeAuth bool) map[string]bool {
445 s := string(b)

Callers 1

initFunction · 0.85

Calls 7

ListAllRecordSetsFunction · 0.92
ConvertRRSetToBindFunction · 0.92
UnexpandSelfAliasesFunction · 0.92
domainZoneFunction · 0.85
getServiceFunction · 0.70
fatalIfErrFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected