func start(dt drivers.DriverType, driver dkvolume.Driver) { h := dkvolume.NewHandler(driver) if isTCPEnabled() { addr := os.Getenv(EnvTCPAddr) if addr == "" { addr, _ = rootCmd.PersistentFlags().GetString(PortFlag) } fmt.Println(h.ServeTCP(dt.String(), addr)) } else { fmt.Println(h.ServeUnix("", dt.String())) } }
func rootForType(dt drivers.DriverType) string { return filepath.Join(baseDir, dt.String()) }