connection

package
v0.1.0-rc.10 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 13 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 connection selects local, SSH or WebSocket transports and reopens read handles. It never retries or replays filesystem mutations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProfilePath

func ProfilePath() string

func SaveProfiles

func SaveProfiles(name string, profiles []Profile) error

Types

type Dialer

type Dialer struct {
	SSH             remote.Connector
	LocalExecutable string
}

func DefaultDialer

func DefaultDialer(executable string, output io.Writer) Dialer

func (Dialer) Dial

func (d Dialer) Dial(ctx context.Context, profile Profile, progress func(string)) (*client.Client, error)

type Endpoint

type Endpoint struct {
	WebSocket string
	SSH       remote.Target
}

type File

type File struct {
	Path string
	Mode protocol.DocumentMode
}

type Profile

type Profile struct {
	WebSocket remote.WebSocketTarget `json:"websocket,omitzero"`
	Name      string                 `json:"name"`
	Directory string                 `json:"directory,omitempty"`
	SSH       remote.Target          `json:"ssh"`
}

func LoadProfiles

func LoadProfiles(name string) []Profile

func (Profile) Address

func (p Profile) Address() string

func (Profile) Endpoint

func (p Profile) Endpoint() Endpoint

Endpoint identifies a connection without allocating or retaining its token.

func (Profile) Label

func (p Profile) Label() string

func (Profile) Namespace

func (p Profile) Namespace() string

Namespace prevents identical remote and local paths sharing history entries.

func (Profile) Remote

func (p Profile) Remote() bool

func (Profile) SameHost

func (p Profile) SameHost(other Profile) bool

SameHost excludes display names, directories and credentials from history identity.

func (Profile) Validate

func (p Profile) Validate() error

type Profiles

type Profiles struct {
	Connections []Profile `json:"connections"`
}

type Project

type Project struct {
	Path  string
	Files []File
}

type RestoredFile

type RestoredFile struct {
	Err      error
	Document *client.Document
	Disk     string
}

type RestoredProject

type RestoredProject struct {
	Err       error
	Workspace protocol.Workspace
	Files     []RestoredFile
}

func Restore

func Restore(ctx context.Context, backend *client.Client, projects []Project) []RestoredProject

Restore only opens workspaces and reads disk baselines. The foreground decides whether its current unsaved buffer can be attached to each fresh document.

Jump to

Keyboard shortcuts

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