Documentation
¶
Index ¶
- type ConnectionHistory
- type ConnectionInfo
- type HistoryManager
- func (hm *HistoryManager) CleanupOldEntries(currentHosts []config.SSHHost) error
- func (hm *HistoryManager) GetAllConnectionsInfo() []ConnectionInfo
- func (hm *HistoryManager) GetConnectionCount(hostName string) int
- func (hm *HistoryManager) GetLastConnectionTime(hostName string) (time.Time, bool)
- func (hm *HistoryManager) GetLastTransfer(hostName string) *TransferHistoryEntry
- func (hm *HistoryManager) GetPortForwardingConfig(hostName string) *PortForwardConfig
- func (hm *HistoryManager) GetTransferHistory(hostName string) []TransferHistoryEntry
- func (hm *HistoryManager) RecordConnection(hostName string) error
- func (hm *HistoryManager) RecordPortForwarding(hostName, forwardType, localPort, remoteHost, remotePort, bindAddress string) error
- func (hm *HistoryManager) RecordTransfer(hostName, direction, localPath, remotePath string) error
- func (hm *HistoryManager) SortHostsByLastUsed(hosts []config.SSHHost) []config.SSHHost
- func (hm *HistoryManager) SortHostsByMostUsed(hosts []config.SSHHost) []config.SSHHost
- type PortForwardConfig
- type TransferHistoryEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionHistory ¶
type ConnectionHistory struct {
Connections map[string]ConnectionInfo `json:"connections"`
}
ConnectionHistory represents the history of SSH connections
type ConnectionInfo ¶
type ConnectionInfo struct {
HostName string `json:"host_name"`
LastConnect time.Time `json:"last_connect"`
ConnectCount int `json:"connect_count"`
PortForwarding *PortForwardConfig `json:"port_forwarding,omitempty"`
TransferHistory []TransferHistoryEntry `json:"transfer_history,omitempty"`
}
ConnectionInfo stores information about a specific connection
type HistoryManager ¶
type HistoryManager struct {
// contains filtered or unexported fields
}
HistoryManager manages the connection history
func NewHistoryManager ¶
func NewHistoryManager() (*HistoryManager, error)
NewHistoryManager creates a new history manager
func (*HistoryManager) CleanupOldEntries ¶
func (hm *HistoryManager) CleanupOldEntries(currentHosts []config.SSHHost) error
CleanupOldEntries removes connection history for hosts that no longer exist
func (*HistoryManager) GetAllConnectionsInfo ¶
func (hm *HistoryManager) GetAllConnectionsInfo() []ConnectionInfo
GetAllConnectionsInfo returns all connection information sorted by last connection time
func (*HistoryManager) GetConnectionCount ¶
func (hm *HistoryManager) GetConnectionCount(hostName string) int
GetConnectionCount returns the total number of connections for a host
func (*HistoryManager) GetLastConnectionTime ¶
func (hm *HistoryManager) GetLastConnectionTime(hostName string) (time.Time, bool)
GetLastConnectionTime returns the last connection time for a host
func (*HistoryManager) GetLastTransfer ¶
func (hm *HistoryManager) GetLastTransfer(hostName string) *TransferHistoryEntry
GetLastTransfer retrieves the most recent transfer for a host
func (*HistoryManager) GetPortForwardingConfig ¶
func (hm *HistoryManager) GetPortForwardingConfig(hostName string) *PortForwardConfig
GetPortForwardingConfig retrieves the last used port forwarding configuration for a host
func (*HistoryManager) GetTransferHistory ¶
func (hm *HistoryManager) GetTransferHistory(hostName string) []TransferHistoryEntry
GetTransferHistory retrieves the transfer history for a host
func (*HistoryManager) RecordConnection ¶
func (hm *HistoryManager) RecordConnection(hostName string) error
RecordConnection records a new connection for the specified host
func (*HistoryManager) RecordPortForwarding ¶
func (hm *HistoryManager) RecordPortForwarding(hostName, forwardType, localPort, remoteHost, remotePort, bindAddress string) error
RecordPortForwarding saves port forwarding configuration for a host
func (*HistoryManager) RecordTransfer ¶
func (hm *HistoryManager) RecordTransfer(hostName, direction, localPath, remotePath string) error
RecordTransfer saves a file transfer record for a host
func (*HistoryManager) SortHostsByLastUsed ¶
func (hm *HistoryManager) SortHostsByLastUsed(hosts []config.SSHHost) []config.SSHHost
SortHostsByLastUsed sorts hosts by their last connection time (most recent first)
func (*HistoryManager) SortHostsByMostUsed ¶
func (hm *HistoryManager) SortHostsByMostUsed(hosts []config.SSHHost) []config.SSHHost
SortHostsByMostUsed sorts hosts by their connection count (most used first)
type PortForwardConfig ¶
type PortForwardConfig struct {
Type string `json:"type"` // "local", "remote", "dynamic"
LocalPort string `json:"local_port"`
RemoteHost string `json:"remote_host"`
RemotePort string `json:"remote_port"`
BindAddress string `json:"bind_address"`
}
PortForwardConfig stores port forwarding configuration