Documentation ¶
Index ¶
- Constants
- func Bicopy(ctx context.Context, c1, c2 io.ReadWriteCloser)
- func ExpandRelativeHomePath(in string) (string, error)
- func New(dialer Dialer, options *Options) io.Closer
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) DialContext(ctx context.Context, network string, addr string) (net.Conn, error)
- func (c *Conn) ReconnectingPTY(id string, height, width uint16, command string) (net.Conn, error)
- func (c *Conn) SSH() (net.Conn, error)
- func (c *Conn) SSHClient() (*ssh.Client, error)
- type Dialer
- type ListenWireguardPeers
- type Metadata
- type Options
- type ReconnectingPTYRequest
- type UploadWireguardKeys
- type WireguardPublicKeys
Constants ¶
const ( ProtocolReconnectingPTY = "reconnecting-pty" ProtocolSSH = "ssh" ProtocolDial = "dial" )
Variables ¶
This section is empty.
Functions ¶
func Bicopy ¶ added in v0.5.11
func Bicopy(ctx context.Context, c1, c2 io.ReadWriteCloser)
Bicopy copies all of the data between the two connections and will close them after one or both of them are done writing. If the context is canceled, both of the connections will be closed.
func ExpandRelativeHomePath ¶ added in v0.5.11
ExpandRelativeHomePath expands the tilde at the beginning of a path to the current user's home directory and returns a full absolute path.
Types ¶
type Conn ¶
type Conn struct { // Negotiator is responsible for exchanging messages. Negotiator proto.DRPCPeerBrokerClient *peer.Conn }
Conn wraps a peer connection with helper functions to communicate with the agent.
func (*Conn) DialContext ¶ added in v0.5.11
DialContext dials an arbitrary protocol+address from inside the workspace and proxies it through the provided net.Conn.
func (*Conn) ReconnectingPTY ¶ added in v0.5.2
ReconnectingPTY returns a connection serving a TTY that can be reconnected to via ID.
The command is optional and defaults to start a shell.
type ListenWireguardPeers ¶ added in v0.7.5
type Options ¶
type Options struct { EnableWireguard bool UploadWireguardKeys UploadWireguardKeys ListenWireguardPeers ListenWireguardPeers ReconnectingPTYTimeout time.Duration EnvironmentVariables map[string]string Logger slog.Logger }
type ReconnectingPTYRequest ¶ added in v0.5.2
type ReconnectingPTYRequest struct { Data string `json:"data"` Height uint16 `json:"height"` Width uint16 `json:"width"` }
ReconnectingPTYRequest is sent from the client to the server to pipe data to a PTY.
type UploadWireguardKeys ¶ added in v0.7.5
type UploadWireguardKeys func(ctx context.Context, keys WireguardPublicKeys) error
type WireguardPublicKeys ¶ added in v0.7.5
type WireguardPublicKeys struct { Public key.NodePublic `json:"public"` Disco key.DiscoPublic `json:"disco"` }