Documentation
¶
Index ¶
- func DefaultConfigPath() string
- func DefaultHistoryPath() string
- type Config
- type Connection
- type Defaults
- type History
- func (h *History) GetLastUsed(id string) (time.Time, bool)
- func (h *History) GetMostUsed(limit int) []string
- func (h *History) GetRecent(limit int) []string
- func (h *History) GetUseCount(id string) int
- func (h *History) RecordUsage(id string)
- func (h *History) RemoveEntry(id string)
- func (h *History) Save() error
- func (h *History) SaveToPath(path string) error
- type HistoryEntry
- type ValidationError
- type ValidationErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func DefaultConfigPath() string
func DefaultHistoryPath ¶
func DefaultHistoryPath() string
DefaultHistoryPath returns the default path for the history file
Types ¶
type Config ¶
type Config struct {
Version int `yaml:"version"`
ThemePreset string `yaml:"theme_preset,omitempty"`
Theme map[string]string `yaml:"theme,omitempty"`
ThemeDark map[string]string `yaml:"theme_dark,omitempty"`
ThemeLight map[string]string `yaml:"theme_light,omitempty"`
Defaults Defaults `yaml:"defaults,omitempty"`
Connections []Connection `yaml:"connections"`
Groups map[string][]string `yaml:"groups,omitempty"`
}
func (*Config) AddConnection ¶
func (c *Config) AddConnection(conn Connection)
func (*Config) DeleteConnection ¶
func (*Config) FindConnection ¶
func (c *Config) FindConnection(id string) *Connection
func (*Config) UpdateConnection ¶
func (c *Config) UpdateConnection(id string, conn Connection) bool
type Connection ¶
type Connection struct {
ID string `yaml:"id"`
Host string `yaml:"host"`
User string `yaml:"user,omitempty"`
Port int `yaml:"port,omitempty"`
Project string `yaml:"project,omitempty"`
Env string `yaml:"env,omitempty"`
IdentityFile string `yaml:"identity_file,omitempty"`
ProxyJump string `yaml:"proxy_jump,omitempty"`
ForwardAgent bool `yaml:"forward_agent,omitempty"`
UseMosh *bool `yaml:"use_mosh,omitempty"`
Tags []string `yaml:"tags,omitempty"`
Options map[string]string `yaml:"options,omitempty"`
}
func (*Connection) EffectiveUser ¶
func (c *Connection) EffectiveUser() string
func (*Connection) Mosh ¶ added in v1.2.0
func (c *Connection) Mosh() bool
Mosh returns whether mosh is enabled for this connection.
func (*Connection) SetMosh ¶ added in v1.2.0
func (c *Connection) SetMosh(v bool)
SetMosh sets the mosh flag on a connection.
type Defaults ¶
type Defaults struct {
User string `yaml:"user,omitempty"`
Port int `yaml:"port,omitempty"`
UseMosh bool `yaml:"use_mosh,omitempty"`
HealthCheck *bool `yaml:"health_check,omitempty"`
}
func (*Defaults) HealthCheckEnabled ¶ added in v1.3.0
HealthCheckEnabled returns whether health checks are enabled (default: true).
type History ¶
type History struct {
Entries []HistoryEntry `yaml:"entries"`
}
History tracks connection usage for recent connections feature
func LoadHistory ¶
LoadHistory loads the history from the default path
func LoadHistoryFromPath ¶
LoadHistoryFromPath loads history from a specific path
func (*History) GetLastUsed ¶
GetLastUsed returns the last used time for a connection
func (*History) GetMostUsed ¶
GetMostUsed returns the most frequently used connection IDs
func (*History) GetUseCount ¶
GetUseCount returns the use count for a connection
func (*History) RecordUsage ¶
RecordUsage records a connection usage
func (*History) RemoveEntry ¶
RemoveEntry removes an entry from history (for when connection is deleted)
func (*History) SaveToPath ¶
SaveToPath saves history to a specific path
type HistoryEntry ¶
type HistoryEntry struct {
ID string `yaml:"id"`
LastUsed time.Time `yaml:"last_used"`
UseCount int `yaml:"use_count"`
}
HistoryEntry represents a single connection usage record
type ValidationError ¶
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type ValidationErrors ¶
type ValidationErrors []ValidationError
func (ValidationErrors) Error ¶
func (e ValidationErrors) Error() string