func (p PortBinding) ContainerAddr() (net.Addr, error) {
	switch p.Proto {
	case UDP:
		return &net.UDPAddr{IP: p.IP, Port: int(p.Port)}, nil
	case TCP:
		return &net.TCPAddr{IP: p.IP, Port: int(p.Port)}, nil
	default:
		return nil, ErrInvalidProtocolBinding(p.Proto.String())
	}
}
ContainerAddr returns the container side transport address
package types
import (
	"bytes"
	"fmt"
	"net"
	"strconv"
	"strings"
)
type UUID string
type TransportPort struct {
	Proto Protocol
	Port  uint16
}
func (t *TransportPort) Equal(o *TransportPort) bool {
	if t == o {
		return true
	}
	if o == nil {
		return false
	}
	if t.Proto != o.Proto || t.Port != o.Port {
		return false
	}
	return true
}
func (t *TransportPort) GetCopy() TransportPort {
	return TransportPort{Proto: t.Proto, Port: t.Port}
}
func (t *TransportPort) String() string {
	return fmt.Sprintf("%s/%d", t.Proto.String(), t.Port)
}
func (t *TransportPort) FromString(s string) error {
	ps := strings.Split(s, "/")
	if len(ps) == 2 {
		t.Proto = ParseProtocol(ps[0])
		if p, err := strconv.ParseUint(ps[1], 10, 16); err == nil {
			t.Port = uint16(p)
			return nil
		}
	}
	return BadRequestErrorf("invalid format for transport port: %s", s)
}
type PortBinding struct {
	Proto       Protocol
	IP          net.IP
	Port        uint16
	HostIP      net.IP
	HostPort    uint16
	HostPortEnd uint16
}
func (p PortBinding) HostAddr() (net.Addr, error) {
	switch p.Proto {
	case UDP:
		return &net.UDPAddr{IP: p.HostIP, Port: int(p.HostPort)}, nil
	case TCP:
		return &net.TCPAddr{IP: p.HostIP, Port: int(p.HostPort)}, nil
	default:
		return nil, ErrInvalidProtocolBinding(p.Proto.String())
	}
}