Documentation
¶
Index ¶
- func ConnectToLiveshare(ctx context.Context, progress progressIndicator, sessionLogger logger, ...) (sess *liveshare.Session, err error)
- func Copy(ctx context.Context, scpArgs []string, port int, destination string) error
- func NewRemoteCommand(ctx context.Context, tunnelPort int, destination string, sshArgs ...string) (*exec.Cmd, error)
- func PollPostCreateStates(ctx context.Context, progress progressIndicator, apiClient apiClient, ...) (err error)
- func Shell(ctx context.Context, p printer, sshArgs []string, port int, destination string, ...) error
- type PostCreateState
- type PostCreateStateStatus
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
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.
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