(ctx context.Context, r53 *route53.Client, zone *route53types.HostedZone, full bool, out io.Writer)
| 444 | } |
| 445 | |
| 446 | func ExportBindToWriter(ctx context.Context, r53 *route53.Client, zone *route53types.HostedZone, full bool, out io.Writer) { |
| 447 | rrsets, err := ListAllRecordSets(ctx, r53, *zone.Id) |
| 448 | fatalIfErr(err) |
| 449 | |
| 450 | sort.Sort(exportSorter{rrsets, *zone.Name}) |
| 451 | dnsname := *zone.Name |
| 452 | fmt.Fprintf(out, "$ORIGIN %s\n", dnsname) |
| 453 | for _, rrset := range rrsets { |
| 454 | rrs := ConvertRRSetToBind(rrset) |
| 455 | UnexpandSelfAliases(rrs, zone, full) |
| 456 | for _, rr := range rrs { |
| 457 | line := rr.String() |
| 458 | if !full { |
| 459 | parts := strings.Split(line, "\t") |
| 460 | parts[0] = shortenName(parts[0], dnsname) |
| 461 | if parts[3] == "CNAME" { |
| 462 | parts[4] = shortenName(parts[4], dnsname) |
| 463 | } |
| 464 | line = strings.Join(parts, "\t") |
| 465 | } |
| 466 | fmt.Fprintln(out, line) |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | type createArgs struct { |
| 472 | name string |
no test coverage detected