cmd

package
v2.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Command

type Command struct {
	*cobra.Command
	// contains filtered or unexported fields
}

Command represents an invocation of the Cloud SQL Auth Proxy.

func NewCommand

func NewCommand(opts ...Option) *Command

NewCommand returns a Command object representing an invocation of the proxy.

type Option

type Option func(*Command)

Option is a function that configures a Command.

func WithAutoIP added in v2.8.2

func WithAutoIP() Option

WithAutoIP enables legacy behavior of v1 and will try to connect to first IP address returned by the SQL Admin API. In most cases, this flag should not be used. Prefer default of public IP or use --private-ip instead.`

func WithDebugLogging added in v2.11.0

func WithDebugLogging() Option

WithDebugLogging configures the Proxy to log debug level messages.

func WithDialer

func WithDialer(d cloudsql.Dialer) Option

WithDialer configures the Command to use the provided dialer to connect to Cloud SQL instances.

func WithFuseDir added in v2.8.2

func WithFuseDir(dir string) Option

WithFuseDir mounts a directory at the path using FUSE to access Cloud SQL instances.

func WithFuseTempDir added in v2.8.2

func WithFuseTempDir(dir string) Option

WithFuseTempDir sets the temp directory where Unix sockets are created with FUSE

func WithLazyRefresh added in v2.11.0

func WithLazyRefresh() Option

WithLazyRefresh configures the Proxy to refresh connection info on an as-needed basis when the cached copy has expired.

func WithLogger

func WithLogger(l cloudsql.Logger) Option

WithLogger overrides the default logger.

func WithMaxConnections added in v2.8.2

func WithMaxConnections(max uint64) Option

WithMaxConnections sets the maximum allowed number of connections. Default is no limit.

func WithQuietLogging added in v2.8.2

func WithQuietLogging() Option

WithQuietLogging configures the Proxy to log error messages only.

func WithUserAgent added in v2.8.2

func WithUserAgent(agent string) Option

WithUserAgent sets additional user agents for Admin API tracking and should be a space separated list of additional user agents, e.g. cloud-sql-proxy-operator/0.0.1,other-agent/1.0.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL