Signed-off-by: allencloud <allen.sun@daocloud.io>
allencloud authored on 2016/11/18 16:51:36... | ... |
@@ -28,7 +28,7 @@ type inputValidationError interface { |
28 | 28 |
IsValidationError() bool |
29 | 29 |
} |
30 | 30 |
|
31 |
-// GetHTTPErrorStatusCode retrieve status code from error message |
|
31 |
+// GetHTTPErrorStatusCode retrieves status code from error message |
|
32 | 32 |
func GetHTTPErrorStatusCode(err error) int { |
33 | 33 |
if err == nil { |
34 | 34 |
logrus.WithFields(logrus.Fields{"error": err}).Error("unexpected HTTP error handling") |
... | ... |
@@ -102,7 +102,7 @@ func (s *Server) serveAPI() error { |
102 | 102 |
} |
103 | 103 |
|
104 | 104 |
// HTTPServer contains an instance of http server and the listener. |
105 |
-// srv *http.Server, contains configuration to create a http server and a mux router with all api end points. |
|
105 |
+// srv *http.Server, contains configuration to create an http server and a mux router with all api end points. |
|
106 | 106 |
// l net.Listener, is a TCP or Socket listener that dispatches incoming request to the router. |
107 | 107 |
type HTTPServer struct { |
108 | 108 |
srv *http.Server |
... | ... |
@@ -495,7 +495,7 @@ func (d *Daemon) SockRequest(method, endpoint string, data interface{}) (int, [] |
495 | 495 |
return res.StatusCode, b, err |
496 | 496 |
} |
497 | 497 |
|
498 |
-// SockRequestRaw executes a socket request on a daemon and returns a http |
|
498 |
+// SockRequestRaw executes a socket request on a daemon and returns an http |
|
499 | 499 |
// response and a reader for the output data. |
500 | 500 |
func (d *Daemon) SockRequestRaw(method, endpoint string, data io.Reader, ct string) (*http.Response, io.ReadCloser, error) { |
501 | 501 |
return sockRequestRawToDaemon(method, endpoint, data, ct, d.sock()) |
... | ... |
@@ -907,7 +907,7 @@ should fix the problem. |
907 | 907 |
## Mapping Ports for External Usage |
908 | 908 |
|
909 | 909 |
The exposed port of an application can be mapped to a host port using the **-p** |
910 |
-flag. For example, a httpd port 80 can be mapped to the host port 8080 using the |
|
910 |
+flag. For example, an httpd port 80 can be mapped to the host port 8080 using the |
|
911 | 911 |
following: |
912 | 912 |
|
913 | 913 |
# docker run -p 8080:80 -d -i -t fedora/httpd |
... | ... |
@@ -86,7 +86,7 @@ func ParseAdvertise(advertise string) (string, error) { |
86 | 86 |
break |
87 | 87 |
} |
88 | 88 |
if addr == "" { |
89 |
- return "", fmt.Errorf("couldnt find a valid ip-address in interface %s", advertise) |
|
89 |
+ return "", fmt.Errorf("could not find a valid ip-address in interface %s", advertise) |
|
90 | 90 |
} |
91 | 91 |
|
92 | 92 |
addr = net.JoinHostPort(addr, port) |