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

Method nextDBPort

internal/proxy/proxy.go:512–530  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

510}
511
512func (c *portConfig) nextDBPort(version string) int {
513 switch {
514 case strings.HasPrefix(version, "MYSQL"):
515 p := c.mysql
516 c.mysql++
517 return p
518 case strings.HasPrefix(version, "POSTGRES"):
519 p := c.postgres
520 c.postgres++
521 return p
522 case strings.HasPrefix(version, "SQLSERVER"):
523 p := c.sqlserver
524 c.sqlserver++
525 return p
526 default:
527 // Unexpected engine version, use global port setting instead.
528 return c.nextPort()
529 }
530}
531
532// Client proxies connections from a local client to the remote server side
533// proxy for multiple Cloud SQL instances.

Callers 1

newSocketMountMethod · 0.80

Calls 1

nextPortMethod · 0.95

Tested by

no test coverage detected