You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hostess/hostlist.go

33 lines
549 B
Go

package hostess
import (
"net"
)
func ContainsHostname(hostnames []*Hostname, hostname *Hostname) bool {
for _, v := range hostnames {
if v.Ip.Equal(hostname.Ip) && v.Domain == hostname.Domain {
return true
}
}
return false
}
func ContainsDomain(hostnames []*Hostname, domain string) bool {
for _, v := range hostnames {
if v.Domain == domain {
return true
}
}
return false
}
func ContainsIp(hostnames []*Hostname, ip net.IP) bool {
for _, v := range hostnames {
if v.Ip.Equal(ip) {
return true
}
}
return false
}