Model: Endpoint.hostname()
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -87,4 +87,15 @@ extension Endpoint {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
func hostname() -> String? {
|
||||
switch (host) {
|
||||
case .name(let hostname, _):
|
||||
return hostname
|
||||
case .ipv4(_):
|
||||
return nil
|
||||
case .ipv6(_):
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user