MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / configureFUSE

Function configureFUSE

internal/proxy/proxy_other.go:36–54  ·  view source on GitHub ↗
(c *Client, conf *Config)

Source from the content-addressed store, hash-verified

34}
35
36func configureFUSE(c *Client, conf *Config) (*Client, error) {
37 if _, err := os.Stat(conf.FUSEDir); err != nil {
38 return nil, err
39 }
40 if err := os.MkdirAll(conf.FUSETempDir, 0777); err != nil {
41 return nil, err
42 }
43 c.fuseMount = fuseMount{
44 fuseDir: conf.FUSEDir,
45 fuseTempDir: conf.FUSETempDir,
46 fuseSockets: map[string]socketSymlink{},
47 // Use pointers for the following mutexes so fuseMount may be embedded
48 // as a value and support zero value lookups on fuseDir.
49 fuseMu: &sync.Mutex{},
50 fuseServerMu: &sync.Mutex{},
51 fuseWg: &sync.WaitGroup{},
52 }
53 return c, nil
54}
55
56type fuseMount struct {
57 // fuseDir specifies the directory where a FUSE server is mounted. The value

Callers 1

NewClientFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected