remote

package
v0.1.0-rc.15 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package remote connects to headless servers through SSH or WebSocket. SSH authentication, config, agent and known_hosts belong to OpenSSH.

Index

Constants

View Source
const OutputChannelName = "Remote Development"

Variables

This section is empty.

Functions

func ConnectWebSocket

func ConnectWebSocket(ctx context.Context, target WebSocketTarget, progress func(string)) (io.ReadWriteCloser, error)

func RunAskpass

func RunAskpass() (bool, error)

RunAskpass handles OpenSSH's helper invocation before the GUI starts. Only this short-lived helper writes the answer to stdout, which SSH owns.

func ValidateToken

func ValidateToken(token string) error

ValidateToken restricts tokens to visible ASCII so they travel unchanged in the Authorization header. Tokens are never included in URLs or diagnostics.

func WithPrompt

func WithPrompt(ctx context.Context, prompt Prompt) context.Context

Types

type AuthenticationPrompt

type AuthenticationPrompt struct {
	Text    string
	Confirm bool
}

AuthenticationPrompt distinguishes secrets from explicit yes/no decisions.

type Connector

type Connector struct {
	Output          io.Writer
	HTTP            *http.Client // Nil uses http.DefaultClient with the connection context.
	Executable      string       // Empty selects ssh from PATH.
	Version         string       // Empty selects the current build version.
	ReleaseURL      string       // Empty selects GitHub release downloads.
	ServerDirectory string       // resources/servers/<os>-<arch>/pencode-server.
	LocalServer     string       // Adjacent native standalone binary.
}

func (Connector) Connect

func (c Connector) Connect(ctx context.Context, target Target, progress func(string)) (conn io.ReadWriteCloser, err error)

Connect authenticates once and returns the same encrypted stdio stream after bootstrap. Passwords are requested through askpass and never retained here.

type Platform

type Platform struct{ OS, Arch string }

func (Platform) String

func (p Platform) String() string

type Prompt

type Prompt func(ctx context.Context, prompt AuthenticationPrompt) (string, error)

Prompt runs outside the UI thread and must return when ctx is canceled.

type Target

type Target struct {
	Host         string `json:"host"`
	IdentityFile string `json:"identityFile,omitempty"`
	ConfigFile   string `json:"configFile,omitempty"`
	ServerBinary string `json:"serverBinary,omitempty"` // Explicit local transfer source.
	ServerRoot   string `json:"serverRoot,omitempty"`   // Absolute POSIX path on the remote host.
	Port         uint16 `json:"port,omitempty"`
}

func (Target) Validate

func (t Target) Validate() error

type WebSocketTarget

type WebSocketTarget struct {
	Address string `json:"address"`
	Token   string `json:"token"`
}

func (WebSocketTarget) Validate

func (t WebSocketTarget) Validate() error

Jump to

Keyboard shortcuts

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