Browse code

fix typos

Signed-off-by: allencloud <allen.sun@daocloud.io>

allencloud authored on 2016/05/23 11:55:17
Showing 11 changed files
... ...
@@ -4,7 +4,7 @@ This document defines the high-level goals of the libnetwork project. See [Proje
4 4
 
5 5
 ## Long-term Goal
6 6
 
7
-libnetwork project will follow Docker and Linux philosophy of delivering small, highly modular and composable tools that works well independently. 
7
+libnetwork project will follow Docker and Linux philosophy of delivering small, highly modular and composable tools that work well independently. 
8 8
 libnetwork aims to satisfy that composable need for Networking in Containers.
9 9
 
10 10
 ## Short-term Goals
... ...
@@ -69,7 +69,7 @@ import (
69 69
 // NetworkController provides the interface for controller instance which manages
70 70
 // networks.
71 71
 type NetworkController interface {
72
-	// ID provides an unique identity for the controller
72
+	// ID provides a unique identity for the controller
73 73
 	ID() string
74 74
 
75 75
 	// Config method returns the bootup configuration for the controller
... ...
@@ -90,7 +90,7 @@ type NetworkController interface {
90 90
 	// NetworkByID returns the Network which has the passed id. If not found, the error ErrNoSuchNetwork is returned.
91 91
 	NetworkByID(id string) (Network, error)
92 92
 
93
-	// NewSandbox cretes a new network sandbox for the passed container id
93
+	// NewSandbox creates a new network sandbox for the passed container id
94 94
 	NewSandbox(containerID string, options ...SandboxOption) (Sandbox, error)
95 95
 
96 96
 	// Sandboxes returns the list of Sandbox(s) managed by this controller.
... ...
@@ -10,7 +10,7 @@ Please refer to this [Docker v1.6 Design](legacy.md) document for more informati
10 10
 
11 11
 ## Goal
12 12
 
13
-libnetwork project will follow Docker and Linux philosophy of developing small, highly modular and composable tools that works well independently.
13
+libnetwork project will follow Docker and Linux philosophy of developing small, highly modular and composable tools that work well independently.
14 14
 Libnetwork aims to satisfy that composable need for Networking in Containers.
15 15
 
16 16
 ## The Container Network Model
... ...
@@ -73,7 +73,7 @@ Consumers of the CNM, like Docker for example, interact through the CNM Objects
73 73
 
74 74
 2. `Network` is created using the controller's `NewNetwork()` API by providing a `name` and `networkType`. `networkType` parameter helps to choose a corresponding `Driver` and binds the created `Network` to that `Driver`. From this point, any operation on `Network` will be handled by that `Driver`.
75 75
 
76
-3. `controller.NewNetwork()` API also takes in optional `options` parameter which carries Driver-specific options and `Labels`, which the Drivers can make use for its purpose.
76
+3. `controller.NewNetwork()` API also takes in optional `options` parameter which carries Driver-specific options and `Labels`, which the Drivers can make use of for its purpose.
77 77
 
78 78
 4. `network.CreateEndpoint()` can be called to create a new Endpoint in a given network. This API also accepts optional `options` parameter which drivers can make use of. These 'options' carry both well-known labels and driver-specific labels. Drivers will in turn be called with `driver.CreateEndpoint` and it can choose to reserve IPv4/IPv6 addresses when an `Endpoint` is created in a `Network`. The `Driver` will assign these addresses using `InterfaceInfo` interface defined in the `driverapi`. The IP/IPv6 are needed to complete the endpoint as service definition along with the ports the endpoint exposes since essentially a service endpoint is nothing but a network address and the port number that the application container is listening on.
79 79
 
... ...
@@ -93,11 +93,11 @@ Consumers of the CNM, like Docker for example, interact through the CNM Objects
93 93
 
94 94
 ### Networks & Endpoints
95 95
 
96
-LibNetwork's Network and Endpoint APIs are primarily for managing the corresponding Objects and book-keeping them to provide a level of abstraction as required by the CNM. It delegates the actual implementation to the drivers which  realize the functionality as promised in the CNM. For more information on these details, please see [the drivers section](#Drivers)
96
+LibNetwork's Network and Endpoint APIs are primarily for managing the corresponding Objects and book-keeping them to provide a level of abstraction as required by the CNM. It delegates the actual implementation to the drivers which realize the functionality as promised in the CNM. For more information on these details, please see [the drivers section](#Drivers)
97 97
 
98 98
 ### Sandbox
99 99
 
100
-Libnetwork provides a framework to implement of a Sandbox in multiple operating systems. Currently we have implemented Sandbox for Linux using `namespace_linux.go` and `configure_linux.go` in `sandbox` package
100
+Libnetwork provides a framework to implement of a Sandbox in multiple operating systems. Currently we have implemented Sandbox for Linux using `namespace_linux.go` and `configure_linux.go` in `sandbox` package.
101 101
 This creates a Network Namespace for each sandbox which is uniquely identified by a path on the host filesystem.
102 102
 Netlink calls are used to move interfaces from the global namespace to the Sandbox namespace.
103 103
 Netlink is also used to manage the routing table in the namespace.
... ...
@@ -106,7 +106,7 @@ Netlink is also used to manage the routing table in the namespace.
106 106
 
107 107
 ## API
108 108
 
109
-Drivers are essentially an extension of libnetwork and provides the actual implementation for all of the LibNetwork APIs defined above. Hence there is an 1-1 correspondence for all the `Network` and `Endpoint` APIs, which includes :
109
+Drivers are essentially an extension of libnetwork and provide the actual implementation for all of the LibNetwork APIs defined above. Hence there is an 1-1 correspondence for all the `Network` and `Endpoint` APIs, which includes :
110 110
 * `driver.Config`
111 111
 * `driver.CreateNetwork`
112 112
 * `driver.DeleteNetwork`
... ...
@@ -115,7 +115,7 @@ Drivers are essentially an extension of libnetwork and provides the actual imple
115 115
 * `driver.Join`
116 116
 * `driver.Leave`
117 117
 
118
-These Driver facing APIs makes use of unique identifiers (`networkid`,`endpointid`,...) instead of names (as seen in user-facing APIs).
118
+These Driver facing APIs make use of unique identifiers (`networkid`,`endpointid`,...) instead of names (as seen in user-facing APIs).
119 119
 
120 120
 The APIs are still work in progress and there can be changes to these based on the driver requirements especially when it comes to Multi-host networking.
121 121
 
... ...
@@ -96,7 +96,7 @@ When the proxy is asked to create a network, the remote process shall receive a
96 96
 		}
97 97
     }
98 98
 
99
-* `NetworkID` value is generated by LibNetwork which represents an unique network. 
99
+* `NetworkID` value is generated by LibNetwork which represents a unique network. 
100 100
 * `Options` value is the arbitrary map given to the proxy by LibNetwork. 
101 101
 * `IPv4Data` and `IPv6Data` are the ip-addressing data configured by the user and managed by IPAM driver. The network driver is expected to honor the ip-addressing data supplied by IPAM driver. The data include,
102 102
 * `AddressSpace` : A unique string represents an isolated space for IP Addressing 
... ...
@@ -35,7 +35,7 @@ func (einc *ErrInvalidNetworkConfig) Error() string {
35 35
 // Forbidden denotes the type of this error
36 36
 func (einc *ErrInvalidNetworkConfig) Forbidden() {}
37 37
 
38
-// ErrInvalidContainerConfig error is returned when a endpoint create is attempted with an invalid configuration.
38
+// ErrInvalidContainerConfig error is returned when an endpoint create is attempted with an invalid configuration.
39 39
 type ErrInvalidContainerConfig struct{}
40 40
 
41 41
 func (eicc *ErrInvalidContainerConfig) Error() string {
... ...
@@ -45,7 +45,7 @@ func (eicc *ErrInvalidContainerConfig) Error() string {
45 45
 // BadRequest denotes the type of this error
46 46
 func (eicc *ErrInvalidContainerConfig) BadRequest() {}
47 47
 
48
-// ErrInvalidEndpointConfig error is returned when a endpoint create is attempted with an invalid endpoint configuration.
48
+// ErrInvalidEndpointConfig error is returned when an endpoint create is attempted with an invalid endpoint configuration.
49 49
 type ErrInvalidEndpointConfig struct{}
50 50
 
51 51
 func (eiec *ErrInvalidEndpointConfig) Error() string {
... ...
@@ -24,7 +24,7 @@ type bridgeInterface struct {
24 24
 
25 25
 // newInterface creates a new bridge interface structure. It attempts to find
26 26
 // an already existing device identified by the configuration BridgeName field,
27
-// or the default bridge name when unspecified), but doesn't attempt to create
27
+// or the default bridge name when unspecified, but doesn't attempt to create
28 28
 // one when missing
29 29
 func newInterface(config *networkConfiguration) *bridgeInterface {
30 30
 	i := &bridgeInterface{}
... ...
@@ -14,7 +14,7 @@ func (nsn ErrNoSuchNetwork) Error() string {
14 14
 // NotFound denotes the type of this error
15 15
 func (nsn ErrNoSuchNetwork) NotFound() {}
16 16
 
17
-// ErrNoSuchEndpoint is returned when a endpoint query finds no result
17
+// ErrNoSuchEndpoint is returned when an endpoint query finds no result
18 18
 type ErrNoSuchEndpoint string
19 19
 
20 20
 func (nse ErrNoSuchEndpoint) Error() string {
... ...
@@ -33,7 +33,7 @@ func SetNamespace() error {
33 33
 	return nil
34 34
 }
35 35
 
36
-// ParseHandlerInt transforms the namespace handler into a integer
36
+// ParseHandlerInt transforms the namespace handler into an integer
37 37
 func ParseHandlerInt() int {
38 38
 	return int(initNs)
39 39
 }
... ...
@@ -60,7 +60,7 @@ type Sandbox interface {
60 60
 	Destroy() error
61 61
 }
62 62
 
63
-// NeighborOptionSetter interfaces defines the option setter methods for interface options
63
+// NeighborOptionSetter interface defines the option setter methods for interface options
64 64
 type NeighborOptionSetter interface {
65 65
 	// LinkName returns an option setter to set the srcName of the link that should
66 66
 	// be used in the neighbor entry
... ...
@@ -99,8 +99,8 @@ type IfaceOptionSetter interface {
99 99
 // interfaces, routes and gateway
100 100
 type Info interface {
101 101
 	// The collection of Interface previously added with the AddInterface
102
-	// method. Note that this doesn't incude network interfaces added in any
103
-	// other way (such as the default loopback interface which are automatically
102
+	// method. Note that this doesn't include network interfaces added in any
103
+	// other way (such as the default loopback interface which is automatically
104 104
 	// created on creation of a sandbox).
105 105
 	Interfaces() []Interface
106 106
 
... ...
@@ -28,7 +28,7 @@ type Sandbox interface {
28 28
 	Labels() map[string]interface{}
29 29
 	// Statistics retrieves the interfaces' statistics for the sandbox
30 30
 	Statistics() (map[string]*types.InterfaceStatistics, error)
31
-	// Refresh leaves all the endpoints, resets and re-apply the options,
31
+	// Refresh leaves all the endpoints, resets and re-applies the options,
32 32
 	// re-joins all the endpoints without destroying the osl sandbox
33 33
 	Refresh(options ...SandboxOption) error
34 34
 	// SetKey updates the Sandbox Key
... ...
@@ -38,9 +38,9 @@ type Sandbox interface {
38 38
 	// Delete destroys this container after detaching it from all connected endpoints.
39 39
 	Delete() error
40 40
 	// ResolveName resolves a service name to an IPv4 or IPv6 address by searching
41
-	// the networks the sandbox is connected to. For IPv6 queries, second  return
41
+	// the networks the sandbox is connected to. For IPv6 queries, second return
42 42
 	// value will be true if the name exists in docker domain but doesn't have an
43
-	// IPv6 address. Such queries shouldn't be forwarded  to external nameservers.
43
+	// IPv6 address. Such queries shouldn't be forwarded to external nameservers.
44 44
 	ResolveName(name string, iplen int) ([]net.IP, bool)
45 45
 	// ResolveIP returns the service name for the passed in IP. IP is in reverse dotted
46 46
 	// notation; the format used for DNS PTR records
... ...
@@ -294,7 +294,7 @@ func (sb *sandbox) Refresh(options ...SandboxOption) error {
294 294
 		return err
295 295
 	}
296 296
 
297
-	// Re -connect to all endpoints
297
+	// Re-connect to all endpoints
298 298
 	for _, ep := range epList {
299 299
 		if err := ep.Join(sb); err != nil {
300 300
 			log.Warnf("Failed attach sandbox %s to endpoint %s: %v\n", sb.ID(), ep.ID(), err)
... ...
@@ -890,7 +890,7 @@ func OptionHostsPath(path string) SandboxOption {
890 890
 }
891 891
 
892 892
 // OptionOriginHostsPath function returns an option setter for origin hosts file path
893
-// tbeo  passed to NewSandbox method.
893
+// to be passed to NewSandbox method.
894 894
 func OptionOriginHostsPath(path string) SandboxOption {
895 895
 	return func(sb *sandbox) {
896 896
 		sb.config.originHostsPath = path
... ...
@@ -24,7 +24,7 @@ type QosPolicy struct {
24 24
 	MaxEgressBandwidth uint64
25 25
 }
26 26
 
27
-// TransportPort represent a local Layer 4 endpoint
27
+// TransportPort represents a local Layer 4 endpoint
28 28
 type TransportPort struct {
29 29
 	Proto Protocol
30 30
 	Port  uint16
... ...
@@ -70,7 +70,7 @@ func (t *TransportPort) FromString(s string) error {
70 70
 	return BadRequestErrorf("invalid format for transport port: %s", s)
71 71
 }
72 72
 
73
-// PortBinding represent a port binding between the container and the host
73
+// PortBinding represents a port binding between the container and the host
74 74
 type PortBinding struct {
75 75
 	Proto       Protocol
76 76
 	IP          net.IP
... ...
@@ -116,7 +116,7 @@ func (p *PortBinding) GetCopy() PortBinding {
116 116
 	}
117 117
 }
118 118
 
119
-// String return the PortBinding structure in string form
119
+// String returns the PortBinding structure in string form
120 120
 func (p *PortBinding) String() string {
121 121
 	ret := fmt.Sprintf("%s/", p.Proto)
122 122
 	if p.IP != nil {