mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix typo
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 1f039a66ac
)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
c125c131d7
commit
0b8f8876b9
5 changed files with 5 additions and 5 deletions
|
@ -28,7 +28,7 @@ type inputValidationError interface {
|
||||||
IsValidationError() bool
|
IsValidationError() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetHTTPErrorStatusCode retrieve status code from error message
|
// GetHTTPErrorStatusCode retrieves status code from error message
|
||||||
func GetHTTPErrorStatusCode(err error) int {
|
func GetHTTPErrorStatusCode(err error) int {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logrus.WithFields(logrus.Fields{"error": err}).Error("unexpected HTTP error handling")
|
logrus.WithFields(logrus.Fields{"error": err}).Error("unexpected HTTP error handling")
|
||||||
|
|
|
@ -102,7 +102,7 @@ func (s *Server) serveAPI() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTPServer contains an instance of http server and the listener.
|
// HTTPServer contains an instance of http server and the listener.
|
||||||
// srv *http.Server, contains configuration to create a http server and a mux router with all api end points.
|
// srv *http.Server, contains configuration to create an http server and a mux router with all api end points.
|
||||||
// l net.Listener, is a TCP or Socket listener that dispatches incoming request to the router.
|
// l net.Listener, is a TCP or Socket listener that dispatches incoming request to the router.
|
||||||
type HTTPServer struct {
|
type HTTPServer struct {
|
||||||
srv *http.Server
|
srv *http.Server
|
||||||
|
|
|
@ -495,7 +495,7 @@ func (d *Daemon) SockRequest(method, endpoint string, data interface{}) (int, []
|
||||||
return res.StatusCode, b, err
|
return res.StatusCode, b, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// SockRequestRaw executes a socket request on a daemon and returns a http
|
// SockRequestRaw executes a socket request on a daemon and returns an http
|
||||||
// response and a reader for the output data.
|
// response and a reader for the output data.
|
||||||
func (d *Daemon) SockRequestRaw(method, endpoint string, data io.Reader, ct string) (*http.Response, io.ReadCloser, error) {
|
func (d *Daemon) SockRequestRaw(method, endpoint string, data io.Reader, ct string) (*http.Response, io.ReadCloser, error) {
|
||||||
return sockRequestRawToDaemon(method, endpoint, data, ct, d.sock())
|
return sockRequestRawToDaemon(method, endpoint, data, ct, d.sock())
|
||||||
|
|
|
@ -907,7 +907,7 @@ should fix the problem.
|
||||||
## Mapping Ports for External Usage
|
## Mapping Ports for External Usage
|
||||||
|
|
||||||
The exposed port of an application can be mapped to a host port using the **-p**
|
The exposed port of an application can be mapped to a host port using the **-p**
|
||||||
flag. For example, a httpd port 80 can be mapped to the host port 8080 using the
|
flag. For example, an httpd port 80 can be mapped to the host port 8080 using the
|
||||||
following:
|
following:
|
||||||
|
|
||||||
# docker run -p 8080:80 -d -i -t fedora/httpd
|
# docker run -p 8080:80 -d -i -t fedora/httpd
|
||||||
|
|
|
@ -86,7 +86,7 @@ func ParseAdvertise(advertise string) (string, error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if addr == "" {
|
if addr == "" {
|
||||||
return "", fmt.Errorf("couldnt find a valid ip-address in interface %s", advertise)
|
return "", fmt.Errorf("could not find a valid ip-address in interface %s", advertise)
|
||||||
}
|
}
|
||||||
|
|
||||||
addr = net.JoinHostPort(addr, port)
|
addr = net.JoinHostPort(addr, port)
|
||||||
|
|
Loading…
Add table
Reference in a new issue