MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / EngineVersion

Method EngineVersion

internal/proxy/proxy_test.go:80–96  ·  view source on GitHub ↗
(_ context.Context, inst string)

Source from the content-addressed store, hash-verified

78}
79
80func (f *fakeDialer) EngineVersion(_ context.Context, inst string) (string, error) {
81 f.mu.Lock()
82 defer f.mu.Unlock()
83 f.engineVersionCount++
84 switch {
85 case strings.Contains(inst, "pg"):
86 return "POSTGRES_14", nil
87 case strings.Contains(inst, "mysql"):
88 return "MYSQL_8_0", nil
89 case strings.Contains(inst, "sqlserver"):
90 return "SQLSERVER_2019_STANDARD", nil
91 case strings.Contains(inst, "fakeserver"):
92 return "", fmt.Errorf("non existing server")
93 default:
94 return "POSTGRES_14", nil
95 }
96}
97
98type errorDialer struct {
99 fakeDialer

Callers

nothing calls this directly

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected