|
@@ -5,7 +5,6 @@ import (
|
|
"bytes"
|
|
"bytes"
|
|
"fmt"
|
|
"fmt"
|
|
"net"
|
|
"net"
|
|
- "strconv"
|
|
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
"github.com/ishidawataru/sctp"
|
|
"github.com/ishidawataru/sctp"
|
|
@@ -69,19 +68,6 @@ func (t *TransportPort) String() string {
|
|
return fmt.Sprintf("%s/%d", t.Proto.String(), t.Port)
|
|
return fmt.Sprintf("%s/%d", t.Proto.String(), t.Port)
|
|
}
|
|
}
|
|
|
|
|
|
-// FromString reads the TransportPort structure from string
|
|
|
|
-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)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// PortBinding represents a port binding between the container and the host
|
|
// PortBinding represents a port binding between the container and the host
|
|
type PortBinding struct {
|
|
type PortBinding struct {
|
|
Proto Protocol
|
|
Proto Protocol
|