Documentation ¶
Index ¶
- func CreateHTTPAuthClient() *http.Client
- func CreateProxy(localPort int, instanceConnectionName CloudSQLInstance)
- func GetDefaultPortForType(dbType CloudSQLInstanceType) int
- func WatchInstances(dir string, cfgs []instanceConfig, updates <-chan string, cl *http.Client) (<-chan proxy.Conn, error)
- type CloudSQLInstance
- type CloudSQLInstanceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHTTPAuthClient ¶
CreateHTTPAuthClient creats http auth client for google apis
func CreateProxy ¶
func CreateProxy(localPort int, instanceConnectionName CloudSQLInstance)
CreateProxy creates a proxy tunnel to a given instance
func GetDefaultPortForType ¶
func GetDefaultPortForType(dbType CloudSQLInstanceType) int
GetDefaultPortForType returns default port for given database type
func WatchInstances ¶
func WatchInstances(dir string, cfgs []instanceConfig, updates <-chan string, cl *http.Client) (<-chan proxy.Conn, error)
WatchInstances handles the lifecycle of local sockets used for proxying local connections. Values received from the updates channel are interpretted as a comma-separated list of instances. The set of sockets in 'dir' is the union of 'instances' and the most recent list from 'updates'.
Types ¶
type CloudSQLInstance ¶
type CloudSQLInstance struct { // project[:region]:instance-name ConnectionName string Type CloudSQLInstanceType DefaultPort int }
CloudSQLInstance struct
func GetInstancesList ¶
func GetInstancesList(projects []string) ([]CloudSQLInstance, error)
GetInstancesList gets list of Cloud SQL instances for given projects
type CloudSQLInstanceType ¶
type CloudSQLInstanceType string
CloudSQLInstanceType is one of supported POSTGRES, MYSQL, SQLSERVER
const ( // TypePostgres cloud SQL instance TypePostgres CloudSQLInstanceType = "POSTGRES" // TypeMySQL cloud SQL instance TypeMySQL CloudSQLInstanceType = "MYSQL" // TypeSQLServer cloud SQL instance TypeSQLServer CloudSQLInstanceType = "SQLSERVER" // TypeUnknown for unknown cloud SQL instance type TypeUnknown CloudSQLInstanceType = "UNKNOWN" )
Click to show internal directories.
Click to hide internal directories.