mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add note on EndpointInfo semantics
The comments in the code don't explain enough, and this is arguably a better place for such an explanation.
This commit is contained in:
parent
3e160cb896
commit
991f50a10c
1 changed files with 11 additions and 1 deletions
|
@ -113,10 +113,20 @@ 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 makes 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.
|
||||
|
||||
### Driver semantics
|
||||
|
||||
* `Driver.CreateEndpoint`
|
||||
|
||||
This method is passed an interface `EndpointInfo`, with methods `Interfaces` and `AddInterface`.
|
||||
|
||||
If the slice returned by `Interfaces` is non-empty, the driver is expected to make use of the interface infomation therein (e.g., treating the address or addresses as statically supplied), and must return an error if it cannot. If the slice is empty, the driver should allocate zero or more _fresh_ interfaces, and use `AddInterface` to record them; or return an error if it cannot.
|
||||
|
||||
It is forbidden to use `AddInterface` if `Interfaces` is non-empty.
|
||||
|
||||
## Implementations
|
||||
|
||||
Libnetwork includes the following driver packages:
|
||||
|
|
Loading…
Add table
Reference in a new issue