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