reconnectingpty

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWidth   = 80
	DefaultHeight  = 24
	DefaultTimeout = httpapi.Duration(5 * time.Minute)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AgentID is the ID of the agent to run the command in.
	AgentID uuid.UUID `json:"agent_id"`
	// Init is the initial packet to send to the agent when launching the TTY.
	// If the ID is not set, defaults to a random UUID. If the width or height
	// is not set, defaults to 80x24. If the command is not set, defaults to
	// opening a login shell. Command runs in the default shell.
	Init codersdk.WorkspaceAgentReconnectingPTYInit `json:"init"`
	// Timeout is the duration to wait for the command to exit. Defaults to
	// 5 minutes.
	Timeout httpapi.Duration `json:"timeout"`
	// ExpectTimeout means we expect the timeout to be reached (i.e. the command
	// doesn't exit within the given timeout).
	ExpectTimeout bool `json:"expect_timeout"`
	// ExpectOutput checks that the given string is present in the output. The
	// string must be present on a single line.
	ExpectOutput string `json:"expect_output"`
	// LogOutput determines whether the output of the command should be logged.
	// For commands that produce a lot of output this should be disabled to
	// avoid loadtest OOMs. All log output is still read and discarded if this
	// is false.
	LogOutput bool `json:"log_output"`
}

func (Config) Validate

func (c Config) Validate() error

type Runner

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

func NewRunner

func NewRunner(client *codersdk.Client, cfg Config) *Runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, _ string, logs io.Writer) error

Run implements Runnable.

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy