codespaces

package
v2.5.0-pre5 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToLiveshare

func ConnectToLiveshare(ctx context.Context, progress progressIndicator, sessionLogger logger, apiClient apiClient, codespace *api.Codespace) (sess *liveshare.Session, err error)

ConnectToLiveshare waits for a Codespace to become running, and connects to it using a Live Share session.

func Copy added in v2.2.0

func Copy(ctx context.Context, scpArgs []string, port int, destination string) error

Copy runs an scp command over the specified port. The arguments may include flags and non-flags, optionally separated by "--".

Remote files indicated by a "remote:" prefix are resolved relative to the remote user's home directory, and are subject to shell expansion on the remote host; see https://lwn.net/Articles/835962/.

func NewRemoteCommand

func NewRemoteCommand(ctx context.Context, tunnelPort int, destination string, sshArgs ...string) (*exec.Cmd, error)

NewRemoteCommand returns an exec.Cmd that will securely run a shell command on the remote machine.

func PollPostCreateStates

func PollPostCreateStates(ctx context.Context, progress progressIndicator, apiClient apiClient, codespace *api.Codespace, poller func([]PostCreateState)) (err error)

PollPostCreateStates watches for state changes in a codespace, and calls the supplied poller for each batch of state changes. It runs until it encounters an error, including cancellation of the context.

func Shell

func Shell(ctx context.Context, p printer, sshArgs []string, port int, destination string, usingCustomPort bool) error

Shell runs an interactive secure shell over an existing port-forwarding session. It runs until the shell is terminated (including by cancellation of the context).

Types

type PostCreateState

type PostCreateState struct {
	Name   string                `json:"name"`
	Status PostCreateStateStatus `json:"status"`
}

PostCreateState is a combination of a state and status value that is captured during codespace creation.

type PostCreateStateStatus

type PostCreateStateStatus string

PostCreateStateStatus is a string value representing the different statuses a state can have.

const (
	PostCreateStateRunning PostCreateStateStatus = "running"
	PostCreateStateSuccess PostCreateStateStatus = "succeeded"
	PostCreateStateFailed  PostCreateStateStatus = "failed"
)

func (PostCreateStateStatus) String

func (p PostCreateStateStatus) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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