2015-02-20 01:37:53 +00:00
|
|
|
package libnetwork
|
|
|
|
|
2015-02-20 06:21:05 +00:00
|
|
|
import (
|
2015-04-13 18:40:42 +00:00
|
|
|
"github.com/docker/libnetwork/driverapi"
|
|
|
|
"github.com/docker/libnetwork/drivers/bridge"
|
2015-05-03 20:37:22 +00:00
|
|
|
"github.com/docker/libnetwork/drivers/host"
|
2015-04-30 05:56:59 +00:00
|
|
|
"github.com/docker/libnetwork/drivers/null"
|
2015-05-06 23:57:38 +00:00
|
|
|
"github.com/docker/libnetwork/drivers/remote"
|
2015-02-20 06:21:05 +00:00
|
|
|
)
|
2015-02-20 01:37:53 +00:00
|
|
|
|
2015-04-13 18:40:42 +00:00
|
|
|
type driverTable map[string]driverapi.Driver
|
2015-02-20 06:21:05 +00:00
|
|
|
|
2015-05-06 23:57:38 +00:00
|
|
|
func enumerateDrivers(dc driverapi.DriverCallback) driverTable {
|
2015-04-15 05:25:42 +00:00
|
|
|
drivers := make(driverTable)
|
|
|
|
|
2015-05-06 23:57:38 +00:00
|
|
|
for _, fn := range [](func(driverapi.DriverCallback) (string, driverapi.Driver)){
|
2015-05-03 20:37:22 +00:00
|
|
|
bridge.New,
|
|
|
|
host.New,
|
|
|
|
null.New,
|
2015-05-06 23:57:38 +00:00
|
|
|
remote.New,
|
2015-05-03 20:37:22 +00:00
|
|
|
} {
|
2015-05-06 23:57:38 +00:00
|
|
|
name, driver := fn(dc)
|
2015-04-13 18:40:42 +00:00
|
|
|
drivers[name] = driver
|
2015-02-20 06:21:05 +00:00
|
|
|
}
|
|
|
|
|
2015-04-13 18:40:42 +00:00
|
|
|
return drivers
|
2015-02-20 17:12:29 +00:00
|
|
|
}
|