func (p *CloudFlareProvider) changesByZone(zones []cloudflare.Zone, changeSet []*cloudFlareChange) map[string][]*cloudFlareChange {
	changes := make(map[string][]*cloudFlareChange)
	zoneNameIDMapper := zoneIDName{}

	for _, z := range zones {
		zoneNameIDMapper.Add(z.ID, z.Name)
		changes[z.ID] = []*cloudFlareChange{}
	}

	for _, c := range changeSet {
		zoneID, _ := zoneNameIDMapper.FindZone(c.ResourceRecordSet[0].Name)
		if zoneID == "" {
			log.Debugf("Skipping record %s because no hosted zone matching record DNS Name was detected ", c.ResourceRecordSet[0].Name)
			continue
		}
		changes[zoneID] = append(changes[zoneID], c)
	}

	return changes
}
func (p *CloudFlareProvider) changesByZone(zones []cloudflare.Zone, changeSet []*cloudFlareChange) map[string][]*cloudFlareChange {
	changes := make(map[string][]*cloudFlareChange)
	zoneNameIDMapper := zoneIDName{}

	for _, z := range zones {
		zoneNameIDMapper.Add(z.ID, z.Name)
		changes[z.ID] = []*cloudFlareChange{}
	}

	for _, c := range changeSet {
		zoneID, _ := zoneNameIDMapper.FindZone(c.ResourceRecordSet[0].Name)
		if zoneID == "" {
			log.Debugf("Skipping record %s because no hosted zone matching record DNS Name was detected ", c.ResourceRecordSet[0].Name)
			continue
		}
		changes[zoneID] = append(changes[zoneID], c)
	}

	return changes
}
func ( p * CloudFlareProvider ) changesByZone ( zones [ ] cloudflare . Zone , changeSet [ ] * cloudFlareChange ) map [ string ] [ ] * cloudFlareChange { changes := make ( map [ string ] [ ] * cloudFlareChange ) zoneNameIDMapper := zoneIDName { } for _ , z := range zones { zoneNameIDMapper . Add ( z . ID , z . Name ) changes [ z . ID ] = [ ] * cloudFlareChange { } } for _ , c := range changeSet { zoneID , _ := zoneNameIDMapper . FindZone ( c . ResourceRecordSet [ 0 ] . Name ) if zoneID == " " { log . Debugf ( " " , c . ResourceRecordSet [ 0 ] . Name ) continue } changes [ zoneID ] = append ( changes [ zoneID ] , c ) } return changes }
// changesByZone separates a multi-zone change into a single change per zone.
changesByZone separates a multi - zone change into a single change per zone .