Documentation
¶
Index ¶
- func AddK8sHost(host K8sHost) error
- func AddSSHHost(host SSHHost) error
- func AddSSHHostToFile(host SSHHost, configPath string) error
- func AddSSHHostWithFileSelection(host SSHHost, targetFile string) error
- func DeleteK8sHost(name string) error
- func DeleteSSHHost(hostName string) error
- func DeleteSSHHostFromFile(hostName, configPath string) error
- func DeleteSSHHostV2(hostName string) error
- func FormatSSHOptionsForCommand(options string) string
- func GetAllConfigFiles() ([]string, error)
- func GetAllConfigFilesFromBase(baseConfigPath string) ([]string, error)
- func GetAppConfigPath() (string, error)
- func GetConfigFilesExcludingCurrent(hostName string, baseConfigFile string) ([]string, error)
- func GetDefaultSSHConfigPath() (string, error)
- func GetIncludedConfigFiles() ([]string, error)
- func GetK8sConfigPath() (string, error)
- func GetSSHDirectory() (string, error)
- func GetSSHMBackupDir() (string, error)
- func GetSSHMConfigDir() (string, error)
- func HostExists(hostName string) (bool, error)
- func HostExistsInFile(hostName string, configPath string) (bool, error)
- func HostExistsInSpecificFile(hostName string, configPath string) (bool, error)
- func IsPartOfMultiHostDeclaration(hostName string, configPath string) (bool, []string, error)
- func K8sConfigExists() bool
- func K8sHostExists(name string) (bool, error)
- func MoveHostToFile(hostName string, targetConfigFile string) error
- func ParseSSHOptionsFromCommand(options string) string
- func QuickHostExists(hostName string) (bool, error)
- func QuickHostExistsInFile(hostName string, configPath string) (bool, error)
- func SaveAppConfig(config *AppConfig) error
- func SaveK8sConfig(hosts []K8sHost) error
- func SetSecureFilePermissions(filepath string) error
- func UpdateK8sHost(oldName string, newHost K8sHost) error
- func UpdateMultiHostBlock(originalHosts, newHosts []string, commonProperties SSHHost, configPath string) error
- func UpdateSSHHost(oldName string, newHost SSHHost) error
- func UpdateSSHHostInFile(oldName string, newHost SSHHost, configPath string) error
- func UpdateSSHHostV2(oldName string, newHost SSHHost) error
- type AppConfig
- type K8sConfig
- type K8sHost
- type KeyBindings
- type SSHHost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddK8sHost ¶ added in v1.0.2
AddK8sHost adds a new k8s host to the config
func AddSSHHost ¶
AddSSHHost adds a new SSH host to the config file
func AddSSHHostToFile ¶
AddSSHHostToFile adds a new SSH host to a specific config file
func AddSSHHostWithFileSelection ¶
AddSSHHostWithFileSelection adds a new SSH host to a user-specified config file
func DeleteK8sHost ¶ added in v1.0.2
DeleteK8sHost removes a k8s host from the config
func DeleteSSHHost ¶
DeleteSSHHost removes an SSH host configuration from the config file
func DeleteSSHHostFromFile ¶
DeleteSSHHostFromFile deletes an SSH host from a specific config file
func DeleteSSHHostV2 ¶
DeleteSSHHostV2 removes an SSH host configuration, searching in all config files
func FormatSSHOptionsForCommand ¶
FormatSSHOptionsForCommand converts SSH config options to command line format Input: "Compression yes\nServerAliveInterval 60" Output: "-o Compression=yes -o ServerAliveInterval=60"
func GetAllConfigFiles ¶
GetAllConfigFiles returns all SSH config files (main + included files)
func GetAllConfigFilesFromBase ¶
GetAllConfigFilesFromBase returns all SSH config files starting from a specific base config file
func GetAppConfigPath ¶
GetAppConfigPath returns the path to the application config file
func GetConfigFilesExcludingCurrent ¶
GetConfigFilesExcludingCurrent returns all config files except the one containing the specified host
func GetDefaultSSHConfigPath ¶
GetDefaultSSHConfigPath returns the default SSH config path for the current platform
func GetIncludedConfigFiles ¶
GetIncludedConfigFiles returns a list of config files that can be used for adding hosts
func GetK8sConfigPath ¶ added in v1.0.2
GetK8sConfigPath returns the path to the k8s config file
func GetSSHDirectory ¶
GetSSHDirectory returns the .ssh directory path
func GetSSHMBackupDir ¶
GetSSHMBackupDir returns the SSHM backup directory
func GetSSHMConfigDir ¶
GetSSHMConfigDir returns the SSHM config directory
func HostExists ¶
HostExists checks if a host already exists in the config
func HostExistsInFile ¶
HostExistsInFile checks if a host exists in a specific config file
func HostExistsInSpecificFile ¶
HostExistsInSpecificFile checks if a host exists in a specific file only (no includes)
func IsPartOfMultiHostDeclaration ¶
IsPartOfMultiHostDeclaration checks if a host is part of a multi-host declaration
func K8sConfigExists ¶ added in v1.0.2
func K8sConfigExists() bool
K8sConfigExists checks if the k8s config file exists
func K8sHostExists ¶ added in v1.0.2
K8sHostExists checks if a k8s host with the given name exists
func MoveHostToFile ¶
MoveHostToFile moves an SSH host from its current config file to a target config file
func ParseSSHOptionsFromCommand ¶
ParseSSHOptionsFromCommand converts SSH command line options to config format Input: "-o Compression=yes -o ServerAliveInterval=60" Output: "Compression yes\nServerAliveInterval 60"
func QuickHostExists ¶
QuickHostExists performs a fast check if a host exists without full parsing This is optimized for connection scenarios where we just need to verify existence
func QuickHostExistsInFile ¶
QuickHostExistsInFile performs a fast check if a host exists in config files This stops parsing as soon as the host is found, making it much faster for connection scenarios
func SaveAppConfig ¶
SaveAppConfig saves the application configuration to file
func SaveK8sConfig ¶ added in v1.0.2
SaveK8sConfig saves the k8s configuration to file
func SetSecureFilePermissions ¶
SetSecureFilePermissions configures secure permissions on Unix systems
func UpdateK8sHost ¶ added in v1.0.2
UpdateK8sHost updates an existing k8s host
func UpdateMultiHostBlock ¶
func UpdateMultiHostBlock(originalHosts, newHosts []string, commonProperties SSHHost, configPath string) error
UpdateMultiHostBlock updates a multi-host block configuration
func UpdateSSHHost ¶
UpdateSSHHost updates an existing SSH host configuration
func UpdateSSHHostInFile ¶
UpdateSSHHostInFile updates an existing SSH host configuration in a specific file
func UpdateSSHHostV2 ¶
Types ¶
type AppConfig ¶
type AppConfig struct {
KeyBindings KeyBindings `json:"key_bindings"`
Theme string `json:"theme"`
SortMode string `json:"sort_mode"` // "name" or "recent"
StartInSearchMode bool `json:"start_in_search_mode"` // Start with search focused
}
AppConfig represents the main application configuration
func GetDefaultAppConfig ¶
func GetDefaultAppConfig() AppConfig
GetDefaultAppConfig returns the default application configuration
func LoadAppConfig ¶
LoadAppConfig loads the application configuration from file If the file doesn't exist, it returns the default configuration
type K8sConfig ¶ added in v1.0.2
type K8sConfig struct {
Hosts []K8sHost `yaml:"hosts"`
}
K8sConfig represents the kubernetes configuration file structure
type K8sHost ¶ added in v1.0.2
type K8sHost struct {
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
Pod string `yaml:"pod"`
Container string `yaml:"container,omitempty"`
Context string `yaml:"context,omitempty"`
Kubeconfig string `yaml:"kubeconfig,omitempty"`
Shell string `yaml:"shell,omitempty"`
Tags []string `yaml:"tags,omitempty"`
}
K8sHost represents a Kubernetes pod connection configuration
func GetK8sHost ¶ added in v1.0.2
GetK8sHost retrieves a specific k8s host by name
func ParseK8sConfig ¶ added in v1.0.2
ParseK8sConfig parses the k8s config file and returns the list of hosts
func (*K8sHost) BuildKubectlCommand ¶ added in v1.0.2
BuildKubectlCommand builds the kubectl exec command for a k8s host
type KeyBindings ¶
type KeyBindings struct {
// Quit keys - keys that will quit the application
QuitKeys []string `json:"quit_keys"`
// DisableEscQuit - if true, ESC key won't quit the application (useful for vim users)
DisableEscQuit bool `json:"disable_esc_quit"`
}
KeyBindings represents configurable key bindings for the application
func GetDefaultKeyBindings ¶
func GetDefaultKeyBindings() KeyBindings
GetDefaultKeyBindings returns the default key bindings configuration
func (*KeyBindings) ShouldQuitOnKey ¶
func (kb *KeyBindings) ShouldQuitOnKey(key string) bool
ShouldQuitOnKey checks if the given key should trigger quit based on configuration
type SSHHost ¶
type SSHHost struct {
Name string
Hostname string
User string
Port string
Identity string
ProxyJump string
Options string
RemoteCommand string // Command to execute after SSH connection
RequestTTY string // Request TTY (yes, no, force, auto)
Tags []string
SourceFile string // Path to the config file where this host is defined
// contains filtered or unexported fields
}
SSHHost represents an SSH host configuration
func FindHostInAllConfigs ¶
FindHostInAllConfigs finds a host in all configuration files and returns the host with its source file
func GetSSHHost ¶
GetSSHHost retrieves a specific host configuration by name
func GetSSHHostFromFile ¶
GetSSHHostFromFile retrieves a specific host configuration by name from a specific config file
func ParseSSHConfig ¶
ParseSSHConfig parses the SSH config file and returns the list of hosts
func ParseSSHConfigFile ¶
ParseSSHConfigFile parses a specific SSH config file and returns the list of hosts