Пример #1
0
func start(dt drivers.DriverType, driver volume.Driver) {
	h := volume.NewHandler(driver)
	if isTCPEnabled() {
		addr := os.Getenv(EnvTCPAddr)
		if addr == "" {
			addr, _ = rootCmd.PersistentFlags().GetString(PortFlag)
		}
		fmt.Println(h.ServeTCP(dt.String(), addr, nil))
	} else {
		fmt.Println(h.ServeUnix("", dt.String()))
	}
}
Пример #2
0
func rootForType(dt drivers.DriverType) string {
	return filepath.Join(baseDir, dt.String())
}