func diffCDNs(cx []*config.CDN, cy []*config.CDN) []*config.CDN {
	var diff []*config.CDN
	for _, x := range cx {
		for _, y := range cy {
			if x.Hostname != y.Hostname {
				continue
			}

			if x.Port != y.Port {
				continue
			}

			if x.IP == y.IP {
				continue
			}

			diff = append(diff, x)
		}
	}

	for _, x := range cx {
		found := false
		for _, y := range cy {
			if idgen.CDNHostID(x.Hostname, x.Port) == idgen.CDNHostID(y.Hostname, y.Port) {
				found = true
				break
			}
		}

		if !found {
			diff = append(diff, x)
		}
	}

	return diff
}
// diffCDNs get cdns with the same HostID but different IP
diffCDNs get cdns with the same HostID but different IP
// diffCDNs get cdns with the same HostID but different IP
func diffCDNs(cx []*config.CDN, cy []*config.CDN) []*config.CDN {
	var diff []*config.CDN
	for _, x := range cx {
		for _, y := range cy {
			if x.Hostname != y.Hostname {
				continue
			}
			if x.Port != y.Port {
				continue
			}
			if x.IP == y.IP {
				continue
			}
			diff = append(diff, x)
		}
	}
	for _, x := range cx {
		found := false
		for _, y := range cy {
			if idgen.CDNHostID(x.Hostname, x.Port) == idgen.CDNHostID(y.Hostname, y.Port) {
				found = true
				break
			}
		}
		if !found {
			diff = append(diff, x)
		}
	}
	return diff
}
func diffCDNs ( cx [ ] * config . CDN , cy [ ] * config . CDN ) [ ] * config . CDN { var diff [ ] * config . CDN for _ , x := range cx { for _ , y := range cy { if x . Hostname != y . Hostname { continue } if x . Port != y . Port { continue } if x . IP == y . IP { continue } diff = append ( diff , x ) } } for _ , x := range cx { found := false for _ , y := range cy { if idgen . CDNHostID ( x . Hostname , x . Port ) == idgen . CDNHostID ( y . Hostname , y . Port ) { found = true break } } if ! found { diff = append ( diff , x ) } } return diff }
diffCDNs get cdns with the same HostID but different IP
diffCDNs get cdns with the same HostID but different IP