|
|
@ -49,6 +49,12 @@ type EndpointAddress struct { |
|
|
|
Port uint16 |
|
|
|
Port uint16 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Name returns the first part of a hostname
|
|
|
|
|
|
|
|
func (ep EndpointAddress) Name() string { |
|
|
|
|
|
|
|
before, _, _ := strings.Cut(ep.Host, ".") |
|
|
|
|
|
|
|
return before |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (ep EndpointAddress) String() string { |
|
|
|
func (ep EndpointAddress) String() string { |
|
|
|
switch { |
|
|
|
switch { |
|
|
|
case ep.Host == "": |
|
|
|
case ep.Host == "": |
|
|
|