fix typos

Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
allencloud 2016-05-23 10:55:17 +08:00
parent 71e5247013
commit 0a8d2f55db
11 changed files with 26 additions and 26 deletions

View File

@ -4,7 +4,7 @@ This document defines the high-level goals of the libnetwork project. See [Proje
## Long-term Goal
libnetwork project will follow Docker and Linux philosophy of delivering small, highly modular and composable tools that works well independently.
libnetwork project will follow Docker and Linux philosophy of delivering small, highly modular and composable tools that work well independently.
libnetwork aims to satisfy that composable need for Networking in Containers.
## Short-term Goals

View File

@ -69,7 +69,7 @@ import (
// NetworkController provides the interface for controller instance which manages
// networks.
type NetworkController interface {
// ID provides an unique identity for the controller
// ID provides a unique identity for the controller
ID() string
// Config method returns the bootup configuration for the controller
@ -90,7 +90,7 @@ type NetworkController interface {
// NetworkByID returns the Network which has the passed id. If not found, the error ErrNoSuchNetwork is returned.
NetworkByID(id string) (Network, error)
// NewSandbox cretes a new network sandbox for the passed container id
// NewSandbox creates a new network sandbox for the passed container id
NewSandbox(containerID string, options ...SandboxOption) (Sandbox, error)
// Sandboxes returns the list of Sandbox(s) managed by this controller.

View File

@ -10,7 +10,7 @@ Please refer to this [Docker v1.6 Design](legacy.md) document for more informati
## Goal
libnetwork project will follow Docker and Linux philosophy of developing small, highly modular and composable tools that works well independently.
libnetwork project will follow Docker and Linux philosophy of developing small, highly modular and composable tools that work well independently.
Libnetwork aims to satisfy that composable need for Networking in Containers.
## The Container Network Model
@ -73,7 +73,7 @@ Consumers of the CNM, like Docker for example, interact through the CNM Objects
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`.
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.
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.
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.
@ -93,11 +93,11 @@ Consumers of the CNM, like Docker for example, interact through the CNM Objects
### Networks & Endpoints
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)
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)
### Sandbox
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
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.
This creates a Network Namespace for each sandbox which is uniquely identified by a path on the host filesystem.
Netlink calls are used to move interfaces from the global namespace to the Sandbox namespace.
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.
## API
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 :
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 :
* `driver.Config`
* `driver.CreateNetwork`
* `driver.DeleteNetwork`
@ -115,7 +115,7 @@ Drivers are essentially an extension of libnetwork and provides the actual imple
* `driver.Join`
* `driver.Leave`
These Driver facing APIs makes use of unique identifiers (`networkid`,`endpointid`,...) instead of names (as seen in user-facing APIs).
These Driver facing APIs make use of unique identifiers (`networkid`,`endpointid`,...) instead of names (as seen in user-facing APIs).
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.

View File

@ -96,7 +96,7 @@ When the proxy is asked to create a network, the remote process shall receive a
}
}
* `NetworkID` value is generated by LibNetwork which represents an unique network.
* `NetworkID` value is generated by LibNetwork which represents a unique network.
* `Options` value is the arbitrary map given to the proxy by LibNetwork.
* `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,
* `AddressSpace` : A unique string represents an isolated space for IP Addressing

View File

@ -35,7 +35,7 @@ func (einc *ErrInvalidNetworkConfig) Error() string {
// Forbidden denotes the type of this error
func (einc *ErrInvalidNetworkConfig) Forbidden() {}
// ErrInvalidContainerConfig error is returned when a endpoint create is attempted with an invalid configuration.
// ErrInvalidContainerConfig error is returned when an endpoint create is attempted with an invalid configuration.
type ErrInvalidContainerConfig struct{}
func (eicc *ErrInvalidContainerConfig) Error() string {
@ -45,7 +45,7 @@ func (eicc *ErrInvalidContainerConfig) Error() string {
// BadRequest denotes the type of this error
func (eicc *ErrInvalidContainerConfig) BadRequest() {}
// ErrInvalidEndpointConfig error is returned when a endpoint create is attempted with an invalid endpoint configuration.
// ErrInvalidEndpointConfig error is returned when an endpoint create is attempted with an invalid endpoint configuration.
type ErrInvalidEndpointConfig struct{}
func (eiec *ErrInvalidEndpointConfig) Error() string {

View File

@ -24,7 +24,7 @@ type bridgeInterface struct {
// newInterface creates a new bridge interface structure. It attempts to find
// an already existing device identified by the configuration BridgeName field,
// or the default bridge name when unspecified), but doesn't attempt to create
// or the default bridge name when unspecified, but doesn't attempt to create
// one when missing
func newInterface(config *networkConfiguration) *bridgeInterface {
i := &bridgeInterface{}

View File

@ -14,7 +14,7 @@ func (nsn ErrNoSuchNetwork) Error() string {
// NotFound denotes the type of this error
func (nsn ErrNoSuchNetwork) NotFound() {}
// ErrNoSuchEndpoint is returned when a endpoint query finds no result
// ErrNoSuchEndpoint is returned when an endpoint query finds no result
type ErrNoSuchEndpoint string
func (nse ErrNoSuchEndpoint) Error() string {

View File

@ -33,7 +33,7 @@ func SetNamespace() error {
return nil
}
// ParseHandlerInt transforms the namespace handler into a integer
// ParseHandlerInt transforms the namespace handler into an integer
func ParseHandlerInt() int {
return int(initNs)
}

View File

@ -60,7 +60,7 @@ type Sandbox interface {
Destroy() error
}
// NeighborOptionSetter interfaces defines the option setter methods for interface options
// NeighborOptionSetter interface defines the option setter methods for interface options
type NeighborOptionSetter interface {
// LinkName returns an option setter to set the srcName of the link that should
// be used in the neighbor entry
@ -99,8 +99,8 @@ type IfaceOptionSetter interface {
// interfaces, routes and gateway
type Info interface {
// The collection of Interface previously added with the AddInterface
// method. Note that this doesn't incude network interfaces added in any
// other way (such as the default loopback interface which are automatically
// method. Note that this doesn't include network interfaces added in any
// other way (such as the default loopback interface which is automatically
// created on creation of a sandbox).
Interfaces() []Interface

View File

@ -28,7 +28,7 @@ type Sandbox interface {
Labels() map[string]interface{}
// Statistics retrieves the interfaces' statistics for the sandbox
Statistics() (map[string]*types.InterfaceStatistics, error)
// Refresh leaves all the endpoints, resets and re-apply the options,
// Refresh leaves all the endpoints, resets and re-applies the options,
// re-joins all the endpoints without destroying the osl sandbox
Refresh(options ...SandboxOption) error
// SetKey updates the Sandbox Key
@ -38,9 +38,9 @@ type Sandbox interface {
// Delete destroys this container after detaching it from all connected endpoints.
Delete() error
// ResolveName resolves a service name to an IPv4 or IPv6 address by searching
// the networks the sandbox is connected to. For IPv6 queries, second return
// the networks the sandbox is connected to. For IPv6 queries, second return
// value will be true if the name exists in docker domain but doesn't have an
// IPv6 address. Such queries shouldn't be forwarded to external nameservers.
// IPv6 address. Such queries shouldn't be forwarded to external nameservers.
ResolveName(name string, iplen int) ([]net.IP, bool)
// ResolveIP returns the service name for the passed in IP. IP is in reverse dotted
// notation; the format used for DNS PTR records
@ -294,7 +294,7 @@ func (sb *sandbox) Refresh(options ...SandboxOption) error {
return err
}
// Re -connect to all endpoints
// Re-connect to all endpoints
for _, ep := range epList {
if err := ep.Join(sb); err != nil {
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 {
}
// OptionOriginHostsPath function returns an option setter for origin hosts file path
// tbeo passed to NewSandbox method.
// to be passed to NewSandbox method.
func OptionOriginHostsPath(path string) SandboxOption {
return func(sb *sandbox) {
sb.config.originHostsPath = path

View File

@ -24,7 +24,7 @@ type QosPolicy struct {
MaxEgressBandwidth uint64
}
// TransportPort represent a local Layer 4 endpoint
// TransportPort represents a local Layer 4 endpoint
type TransportPort struct {
Proto Protocol
Port uint16
@ -70,7 +70,7 @@ func (t *TransportPort) FromString(s string) error {
return BadRequestErrorf("invalid format for transport port: %s", s)
}
// PortBinding represent a port binding between the container and the host
// PortBinding represents a port binding between the container and the host
type PortBinding struct {
Proto Protocol
IP net.IP
@ -116,7 +116,7 @@ func (p *PortBinding) GetCopy() PortBinding {
}
}
// String return the PortBinding structure in string form
// String returns the PortBinding structure in string form
func (p *PortBinding) String() string {
ret := fmt.Sprintf("%s/", p.Proto)
if p.IP != nil {