sshconfig¶
Package sshconfig manages the local SSH configuration for codespace connections. It writes per-codespace config files into \~/.ssh/codespaces-zed/ and ensures the main \~/.ssh/config includes them.
Index¶
- Constants
- func EnsureConfigIncludesGenerated(mainConfigPath string) error
- func EnsureIncludeLine(configText string) string
- func ParsePrimaryHostAlias(sshConfig string) (string, error)
- func ReadExistingAlias(includeDir, codespaceName string) (string, bool)
- func WriteCodespaceConfig(includeDir, codespaceName, content string) error
- type SSHPaths
- func ResolvePaths() SSHPaths
- func (p SSHPaths) CodespaceConfigPath(codespaceName string) string
Constants¶
func EnsureConfigIncludesGenerated¶
EnsureConfigIncludesGenerated ensures the main SSH config includes the generated configs.
func EnsureIncludeLine¶
EnsureIncludeLine ensures the SSH include line is at the top of the config. It removes any existing copy and prepends it.
func ParsePrimaryHostAlias¶
ParsePrimaryHostAlias extracts the first concrete Host entry from SSH config text.
func ReadExistingAlias¶
ReadExistingAlias reads the SSH alias from an existing codespace config file. Returns the alias and true if the file exists and contains a valid Host entry, or empty string and false otherwise.
func WriteCodespaceConfig¶
WriteCodespaceConfig writes the SSH config for a specific codespace.
type SSHPaths¶
SSHPaths holds the resolved SSH directory paths.
func ResolvePaths¶
ResolvePaths returns the SSH paths for the current platform.
func (SSHPaths) CodespaceConfigPath¶
CodespaceConfigPath returns the path for a codespace-specific SSH config.
Generated by gomarkdoc