@@ -26,16 +26,16 @@ import (
2626// A Network represents a logical connectivity zone that containers may
2727// join using the Link method. A Network is managed by a specific driver.
2828type Network interface {
29- // A user chosen name for this network.
29+ // Name returns a user chosen name for this network.
3030 Name () string
3131
32- // A system generated id for this network.
32+ // ID returns a system generated id for this network.
3333 ID () string
3434
35- // The type of network, which corresponds to its managing driver.
35+ // Type returns the type of network, which corresponds to its managing driver.
3636 Type () string
3737
38- // Create a new endpoint to this network symbolically identified by the
38+ // CreateEndpoint creates a new endpoint to this network symbolically identified by the
3939 // specified unique name. The options parameter carries driver specific options.
4040 CreateEndpoint (name string , options ... EndpointOption ) (Endpoint , error )
4141
@@ -45,7 +45,7 @@ type Network interface {
4545 // Endpoints returns the list of Endpoint(s) in this network.
4646 Endpoints () []Endpoint
4747
48- // WalkEndpoints uses the provided function to walk the Endpoints
48+ // WalkEndpoints uses the provided function to walk the Endpoints.
4949 WalkEndpoints (walker EndpointWalker )
5050
5151 // EndpointByName returns the Endpoint which has the passed name. If not found, the error ErrNoSuchEndpoint is returned.
@@ -54,7 +54,7 @@ type Network interface {
5454 // EndpointByID returns the Endpoint which has the passed id. If not found, the error ErrNoSuchEndpoint is returned.
5555 EndpointByID (id string ) (Endpoint , error )
5656
57- // Return certain operational data belonging to this network
57+ // Info returns certain operational data belonging to this network.
5858 Info () NetworkInfo
5959}
6060
@@ -78,8 +78,8 @@ type NetworkInfo interface {
7878 // gossip cluster. For non-dynamic overlay networks and bridge networks it returns an
7979 // empty slice
8080 Peers () []networkdb.PeerInfo
81- //Services returns a map of services keyed by the service name with the details
82- //of all the tasks that belong to the service. Applicable only in swarm mode.
81+ // Services returns a map of services keyed by the service name with the details
82+ // of all the tasks that belong to the service. Applicable only in swarm mode.
8383 Services () map [string ]ServiceInfo
8484}
8585
@@ -89,7 +89,7 @@ type EndpointWalker func(ep Endpoint) bool
8989
9090// ipInfo is the reverse mapping from IP to service name to serve the PTR query.
9191// extResolver is set if an external server resolves a service name to this IP.
92- // Its an indication to defer PTR queries also to that external server.
92+ // It's an indication to defer PTR queries also to that external server.
9393type ipInfo struct {
9494 name string
9595 serviceID string
@@ -130,15 +130,15 @@ type networkDBTable struct {
130130
131131// IpamConf contains all the ipam related configurations for a network
132132type IpamConf struct {
133- // The master address pool for containers and network interfaces
133+ // PreferredPool is the master address pool for containers and network interfaces.
134134 PreferredPool string
135- // A subset of the master pool. If specified,
136- // this becomes the container pool
135+ // SubPool is a subset of the master pool. If specified,
136+ // this becomes the container pool.
137137 SubPool string
138- // Preferred Network Gateway address (optional)
138+ // Gateway is the preferred Network Gateway address (optional).
139139 Gateway string
140- // Auxiliary addresses for network driver. Must be within the master pool.
141- // libnetwork will reserve them if they fall into the container pool
140+ // AuxAddresses contains auxiliary addresses for network driver. Must be within the master pool.
141+ // libnetwork will reserve them if they fall into the container pool.
142142 AuxAddresses map [string ]string
143143}
144144
@@ -415,7 +415,7 @@ func (n *network) validateConfiguration() error {
415415 return nil
416416}
417417
418- // Applies network specific configurations
418+ // applyConfigurationTo applies network specific configurations.
419419func (n * network ) applyConfigurationTo (to * network ) error {
420420 to .enableIPv6 = n .enableIPv6
421421 if len (n .labels ) > 0 {
@@ -1197,12 +1197,12 @@ func (n *network) createEndpoint(name string, options ...EndpointOption) (Endpoi
11971197 }
11981198 }
11991199
1200- ipam , cap , err := n .getController ().getIPAMDriver (n .ipamType )
1200+ ipam , capability , err := n .getController ().getIPAMDriver (n .ipamType )
12011201 if err != nil {
12021202 return nil , err
12031203 }
12041204
1205- if cap .RequiresMACAddress {
1205+ if capability .RequiresMACAddress {
12061206 if ep .iface .mac == nil {
12071207 ep .iface .mac = netutils .GenerateRandomMAC ()
12081208 }
@@ -2236,14 +2236,14 @@ func (n *network) deleteLoadBalancerSandbox() error {
22362236 if sb != nil {
22372237 if err := sb .DisableService (); err != nil {
22382238 logrus .Warnf ("Failed to disable service on sandbox %s: %v" , sandboxName , err )
2239- //Ignore error and attempt to delete the load balancer endpoint
2239+ // Ignore error and attempt to delete the load balancer endpoint
22402240 }
22412241 }
22422242 }
22432243
22442244 if err := endpoint .Delete (true ); err != nil {
22452245 logrus .Warnf ("Failed to delete endpoint %s (%s) in %s: %v" , endpoint .Name (), endpoint .ID (), sandboxName , err )
2246- //Ignore error and attempt to delete the sandbox.
2246+ // Ignore error and attempt to delete the sandbox.
22472247 }
22482248 }
22492249
0 commit comments