|
1 | 1 | package driverapi |
2 | 2 |
|
3 | | -import "net" |
| 3 | +import ( |
| 4 | + "net" |
| 5 | + |
| 6 | + "github.com/docker/libnetwork/discoverapi" |
| 7 | +) |
4 | 8 |
|
5 | 9 | // NetworkPluginEndpointType represents the Endpoint Type used by Plugin system |
6 | 10 | const NetworkPluginEndpointType = "NetworkDriver" |
7 | 11 |
|
8 | 12 | // Driver is an interface that every plugin driver needs to implement. |
9 | 13 | type Driver interface { |
| 14 | + discoverapi.Discover |
| 15 | + |
10 | 16 | // CreateNetwork invokes the driver method to create a network passing |
11 | 17 | // the network id and network specific config. The config mechanism will |
12 | 18 | // eventually be replaced with labels which are yet to be introduced. |
@@ -36,12 +42,6 @@ type Driver interface { |
36 | 42 | // Leave method is invoked when a Sandbox detaches from an endpoint. |
37 | 43 | Leave(nid, eid string) error |
38 | 44 |
|
39 | | - // DiscoverNew is a notification for a new discovery event, Example:a new node joining a cluster |
40 | | - DiscoverNew(dType DiscoveryType, data interface{}) error |
41 | | - |
42 | | - // DiscoverDelete is a notification for a discovery delete event, Example:a node leaving a cluster |
43 | | - DiscoverDelete(dType DiscoveryType, data interface{}) error |
44 | | - |
45 | 45 | // Type returns the the type of this driver, the network type this driver manages |
46 | 46 | Type() string |
47 | 47 | } |
@@ -107,20 +107,6 @@ type Capability struct { |
107 | 107 | DataScope string |
108 | 108 | } |
109 | 109 |
|
110 | | -// DiscoveryType represents the type of discovery element the DiscoverNew function is invoked on |
111 | | -type DiscoveryType int |
112 | | - |
113 | | -const ( |
114 | | - // NodeDiscovery represents Node join/leave events provided by discovery |
115 | | - NodeDiscovery = iota + 1 |
116 | | -) |
117 | | - |
118 | | -// NodeDiscoveryData represents the structure backing the node discovery data json string |
119 | | -type NodeDiscoveryData struct { |
120 | | - Address string |
121 | | - Self bool |
122 | | -} |
123 | | - |
124 | 110 | // IPAMData represents the per-network ip related |
125 | 111 | // operational information libnetwork will send |
126 | 112 | // to the network driver during CreateNetwork() |
|
0 commit comments