agent

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dialer Dialer, options *Options) io.Closer

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) Close

func (c *Conn) Close() error

func (*Conn) ReconnectingPTY added in v0.5.2

func (c *Conn) ReconnectingPTY(id string, height, width uint16) (net.Conn, error)

ReconnectingPTY returns a connection serving a TTY that can be reconnected to via ID.

func (*Conn) SSH

func (c *Conn) SSH() (net.Conn, error)

SSH dials the built-in SSH server.

func (*Conn) SSHClient

func (c *Conn) SSHClient() (*ssh.Client, error)

SSHClient calls SSH to create a client that uses a weak cipher for high throughput.

type Dialer

type Dialer func(ctx context.Context, logger slog.Logger) (Metadata, *peerbroker.Listener, error)

type Metadata added in v0.5.1

type Metadata struct {
	OwnerEmail           string            `json:"owner_email"`
	OwnerUsername        string            `json:"owner_username"`
	EnvironmentVariables map[string]string `json:"environment_variables"`
	StartupScript        string            `json:"startup_script"`
	Directory            string            `json:"directory"`
}

type Options

type Options struct {
	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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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