{"modulePath":"github.com/pencode-labs/pencode","version":"v0.1.0-rc.15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package connection\n\nPackage connection selects local, SSH or WebSocket transports and reopens read handles. It never retries or replays filesystem mutations.\n\n## Functions\n\n```go\nfunc ProfilePath() string\n```\n\n```go\nfunc SaveProfiles(name string, profiles []Profile) error\n```\n\n## Types\n\n```go\ntype Dialer struct {\n\tSSH             remote.Connector\n\tLocalExecutable string\n}\n```\n\n```go\nfunc DefaultDialer(executable string, output io.Writer) Dialer\n```\n\n```go\nfunc (d Dialer) Dial(ctx context.Context, profile Profile, progress func(string)) (*client.Client, error)\n```\n\n```go\ntype Endpoint struct {\n\tWebSocket string\n\tSSH       remote.Target\n}\n```\n\n```go\ntype File struct {\n\tPath string\n\tMode protocol.DocumentMode\n}\n```\n\n```go\ntype Profile struct {\n\tWebSocket remote.WebSocketTarget `json:\"websocket,omitzero\"`\n\tName      string                 `json:\"name\"`\n\tDirectory string                 `json:\"directory,omitempty\"`\n\tSSH       remote.Target          `json:\"ssh\"`\n}\n```\n\n```go\nfunc LoadProfiles(name string) []Profile\n```\n\n```go\nfunc (p Profile) Address() string\n```\n\n```go\nfunc (p Profile) Endpoint() Endpoint\n```\nEndpoint identifies a connection without allocating or retaining its token.\n\n```go\nfunc (p Profile) Label() string\n```\n\n```go\nfunc (p Profile) Namespace() string\n```\nNamespace prevents identical remote and local paths sharing history entries.\n\n```go\nfunc (p Profile) Remote() bool\n```\n\n```go\nfunc (p Profile) SameHost(other Profile) bool\n```\nSameHost excludes display names, directories and credentials from history identity.\n\n```go\nfunc (p Profile) Validate() error\n```\n\n```go\ntype Profiles struct {\n\tConnections []Profile `json:\"connections\"`\n}\n```\n\n```go\ntype Project struct {\n\tPath  string\n\tFiles []File\n}\n```\n\n```go\ntype RestoredFile struct {\n\tErr      error\n\tDocument *client.Document\n\tDisk     string\n}\n```\n\n```go\ntype RestoredProject struct {\n\tErr       error\n\tWorkspace protocol.Workspace\n\tFiles     []RestoredFile\n}\n```\n\n```go\nfunc Restore(ctx context.Context, backend *client.Client, projects []Project) []RestoredProject\n```\nRestore only opens workspaces and reads disk baselines. The foreground decides whether its current unsaved buffer can be attached to each fresh document.\n\n","path":"github.com/pencode-labs/pencode/connection","name":"connection","synopsis":"Package connection selects local, SSH or WebSocket transports and reopens read handles.","isRedistributable":true}
