Documentation
¶
Index ¶
- func CreateSigners(privateKeys [][]byte) ([]ssh.Signer, error)
- func CreateUptermRuntimeDir() (string, error)
- func DefaultLocalhost(defaultPort string) string
- func FingerprintSHA256(key ssh.PublicKey) string
- func GenerateSessionID() string
- func KeysEqual(pk1 ssh.PublicKey, pk2 ssh.PublicKey) bool
- func ReadFiles(paths []string) ([][]byte, error)
- func ShortenHomePath(path string) string
- func UptermConfigDir() string
- func UptermConfigFilePath() string
- func UptermLogFilePath() string
- func UptermRuntimeDir() string
- func UptermStateDir() string
- func WaitForServer(ctx context.Context, addr string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUptermRuntimeDir ¶ added in v0.18.0
CreateUptermRuntimeDir creates the runtime directory for sockets. Mode 0700 ensures only the current user can access sockets.
func DefaultLocalhost ¶
func FingerprintSHA256 ¶
func GenerateSessionID ¶
func GenerateSessionID() string
func ShortenHomePath ¶ added in v0.22.0
ShortenHomePath replaces the home directory prefix with ~ for cleaner display. If the path doesn't start with home directory, it's returned unchanged. Always uses forward slash after ~ for consistency across platforms.
func UptermConfigDir ¶ added in v0.18.0
func UptermConfigDir() string
UptermConfigDir returns the directory for configuration files.
Following the XDG Base Directory Specification, this directory maps to XDG_CONFIG_HOME/upterm and persists across sessions.
Directory selection priority:
- $XDG_CONFIG_HOME/upterm (if XDG_CONFIG_HOME is explicitly set)
- Platform default if accessible: - Linux: ~/.config/upterm - macOS: ~/Library/Application Support/upterm - Windows: %LOCALAPPDATA%\upterm
- Fallback: $HOME/.upterm
- Final fallback: os.TempDir()/.upterm (if HOME unavailable)
func UptermConfigFilePath ¶ added in v0.18.0
func UptermConfigFilePath() string
UptermConfigFilePath returns the path to the config file.
Following the XDG Base Directory Specification, this file is stored in XDG_CONFIG_HOME/upterm and persists across sessions.
Platform-specific paths:
- Linux: ~/.config/upterm/config.yaml
- macOS: ~/Library/Application Support/upterm/config.yaml
- Windows: %LOCALAPPDATA%\upterm\config.yaml
Note: The config file is optional and created manually by users.
func UptermLogFilePath ¶ added in v0.16.0
func UptermLogFilePath() string
UptermLogFilePath returns the path to the log file in the state directory.
Following the XDG Base Directory Specification, this file is stored in XDG_STATE_HOME/upterm and persists across sessions.
Platform-specific paths:
- Linux: ~/.local/state/upterm/upterm.log
- macOS: ~/Library/Application Support/upterm/upterm.log
- Windows: %LOCALAPPDATA%\upterm\upterm.log
Note: The directory is created lazily by the logging system when the file is opened.
func UptermRuntimeDir ¶ added in v0.18.0
func UptermRuntimeDir() string
UptermRuntimeDir returns the directory for runtime files (sockets).
Following the XDG Base Directory Specification, this directory maps to XDG_RUNTIME_DIR/upterm when available and is typically cleaned on logout/reboot.
Directory selection priority:
- $XDG_RUNTIME_DIR/upterm (if XDG_RUNTIME_DIR is explicitly set)
- Platform default if accessible: - Linux: /run/user/1000/upterm (requires login session) - macOS: $TMPDIR/upterm (e.g., /var/folders/.../T/upterm) - Windows: %LOCALAPPDATA%\upterm
- Fallback: $HOME/.upterm (for non-interactive environments)
- Final fallback: os.TempDir()/.upterm (if HOME unavailable)
func UptermStateDir ¶ added in v0.18.0
func UptermStateDir() string
UptermStateDir returns the directory for state files (logs).
Following the XDG Base Directory Specification, this directory maps to XDG_STATE_HOME/upterm and persists across sessions.
Directory selection priority:
- $XDG_STATE_HOME/upterm (if XDG_STATE_HOME is explicitly set)
- Platform default if accessible: - Linux: ~/.local/state/upterm - macOS: ~/Library/Application Support/upterm - Windows: %LOCALAPPDATA%\upterm
- Fallback: $HOME/.upterm
- Final fallback: os.TempDir()/.upterm (if HOME unavailable)
Types ¶
This section is empty.