{"modulePath":"github.com/GoogleCloudPlatform/cloud-sql-proxy","version":"v1.14.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package util\n\nPackage util contains utility functions for use throughout the Cloud SQL Proxy.\n\n## Functions\n\n```go\nfunc GcloudTokenSource(ctx context.Context) (oauth2.TokenSource, error)\n```\n\n```go\nfunc SplitName(instance string) (project, region, name string)\n```\nSplitName splits a fully qualified instance into its project, region, and instance name components. While we make the transition to regionalized metadata, the region is optional.\n\nExamples:\n\n\t   \"proj:region:my-db\" -\u003e (\"proj\", \"region\", \"my-db\")\n\t\t\t\"google.com:project:region:instance\" -\u003e (\"google.com:project\", \"region\", \"instance\")\n\t\t\t\"google.com:missing:part\" -\u003e (\"google.com:missing\", \"\", \"part\")\n\n## Types\n\n```go\ntype GcloudConfigData struct {\n\tConfiguration struct {\n\t\tProperties struct {\n\t\t\tCore struct {\n\t\t\t\tProject string\n\t\t\t\tAccount string\n\t\t\t}\n\t\t}\n\t}\n\tCredential struct {\n\t\tAccessToken string    `json:\"access_token\"`\n\t\tTokenExpiry time.Time `json:\"token_expiry\"`\n\t}\n}\n```\nGcloudConfigData represents the data returned by \\`gcloud config config-helper\\`.\n\n```go\nfunc GcloudConfig() (*GcloudConfigData, error)\n```\nGcloudConfig returns a GcloudConfigData object or an error of type \\*GcloudError.\n\n```go\ntype GcloudError struct {\n\tGcloudError error\n\tStatus      GcloudStatusCode\n}\n```\n\n```go\nfunc (e *GcloudError) Error() string\n```\n\n```go\ntype GcloudStatusCode int\n```\n\n```go\nconst (\n\tGcloudOk GcloudStatusCode = iota\n\tGcloudNotFound\n\t// generic execution failure error not specified above.\n\tGcloudExecErr\n)\n```\n\n","path":"github.com/GoogleCloudPlatform/cloud-sql-proxy/proxy/util","name":"util","synopsis":"Package util contains utility functions for use throughout the Cloud SQL Proxy.","isRedistributable":true}
