Help us shape the future of Go! Take the 2026 Go Developer Survey

proxycmd

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package proxycmd reaches a database through a command whose stdin and stdout carry the connection, as OpenSSH's ProxyCommand: docker exec, kubectl exec, or ssh to a host that relays to a socket. It serves databases that publish no port.

The command runs without a shell, as the console account, in a session of its own with no controlling terminal, so that it can neither read what the human types into the console nor prompt there, and with an environment reduced to what such tools need to find their sockets and configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy opens connections by running one argv per connection.

func New

func New(argv []string) *Proxy

New returns a Proxy running argv; argv[0] is looked up in PATH unless it is a path.

func (*Proxy) Dial

func (p *Proxy) Dial(ctx context.Context, network, addr string) (net.Conn, error)

Dial starts the command and returns its stdin and stdout as one connection; network and addr are ignored, the command knows where the database is. Closing the connection ends the command.

func (*Proxy) Stderr

func (p *Proxy) Stderr() string

Stderr is the sanitized tail of what the last command that ended wrote to its stderr, "" when it wrote nothing.

Jump to

Keyboard shortcuts

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