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-04-30 01:56:59 -04:00
|
|
|
"github.com/docker/libnetwork/drivers/null"
|
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-04-13 14:40:42 -04:00
|
|
|
func enumerateDrivers() driverTable {
|
2015-04-15 01:25:42 -04:00
|
|
|
drivers := make(driverTable)
|
|
|
|
|
2015-04-30 01:56:59 -04:00
|
|
|
for _, fn := range [](func() (string, driverapi.Driver)){bridge.New, null.New} {
|
2015-04-13 14:40:42 -04:00
|
|
|
name, driver := fn()
|
|
|
|
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
|
|
|
}
|