func UnixSocketDir()

in internal/proxy/proxy.go [428:441]


func UnixSocketDir(dir, inst string) (string, error) {
	project, region, cluster, name, err := ParseInstanceURI(strings.ToLower(inst))
	if err != nil {
		return "", err
	}
	// Colons are not allowed on Windows, but are present in legacy project
	// names (e.g., google.com:myproj). Replace any colon with an underscore to
	// support Windows. Underscores are not allowed in project names. So use an
	// underscore to have a Windows-friendly delimitor that can serve as a
	// marker to recover the legacy project name when necessary (e.g., FUSE).
	project = strings.ReplaceAll(project, ":", "_")
	shortName := strings.Join([]string{project, region, cluster, name}, ".")
	return filepath.Join(dir, shortName), nil
}