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

Function groupRecords

commands.go:210–227  ·  view source on GitHub ↗
(records []dns.RR)

Source from the content-addressed store, hash-verified

208}
209
210func groupRecords(records []dns.RR) map[Key][]dns.RR {
211 // group records by name+type and optionally identifier
212 grouped := map[Key][]dns.RR{}
213 for _, record := range records {
214 var identifier string
215 if aws, ok := record.(*AWSRR); ok {
216 identifier = aws.Identifier
217 }
218 if alias, ok := record.(*dns.PrivateRR); ok {
219 // issue #195: alias records need to be keyed by the type of the alias too
220 rdata := alias.Data.(*ALIASRdata)
221 identifier += "@" + rdata.Type
222 }
223 key := Key{record.Header().Name, record.Header().Rrtype, identifier}
224 grouped[key] = append(grouped[key], record)
225 }
226 return grouped
227}
228
229type importArgs struct {
230 name string

Callers 2

importBindFunction · 0.85
createRecordsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected