mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-21 00:24:07 +08:00
Conflicts: Gopkg.lock pkg/appsrv/appsrv.go pkg/cloudcommon/options.go pkg/compute/models/hosts.go pkg/compute/models/quotas.go pkg/compute/service/service.go pkg/mcclient/mcclient.go
20 lines
315 B
Go
20 lines
315 B
Go
package missinggo
|
|
|
|
import (
|
|
"net"
|
|
"strconv"
|
|
)
|
|
|
|
type IpPort struct {
|
|
IP net.IP
|
|
Port uint16
|
|
}
|
|
|
|
func (me IpPort) String() string {
|
|
return net.JoinHostPort(me.IP.String(), strconv.FormatUint(uint64(me.Port), 10))
|
|
}
|
|
|
|
func IpPortFromNetAddr(na net.Addr) IpPort {
|
|
return IpPort{AddrIP(na), uint16(AddrPort(na))}
|
|
}
|