sshurl

package
v1.60.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package sshurl parses ssh:// URLs into components for use with the ssh binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parsed

type Parsed struct {
	Host string // hostname or user@hostname
	Port string // port number, or "" for default
	Path string // absolute remote path (starts with /)
}

Parsed holds the components of an ssh:// URL.

func Parse

func Parse(raw string) (Parsed, error)

Parse parses an ssh:// URL into host, port, and path components. Accepts formats like ssh://host/path, ssh://user@host/path, ssh://host:2222/path.

func (Parsed) SSHArgs

func (p Parsed) SSHArgs() []string

SSHArgs returns the ssh command arguments for connecting to this host. If a port is specified, -p is included.

Jump to

Keyboard shortcuts

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