Documentation ¶
Index ¶
- Constants
- type Connection
- type ConnectionManager
- func (cm *ConnectionManager) AddConnection(host string, user string, port int, password *string) error
- func (cm *ConnectionManager) DeleteConnection(index int) error
- func (cm ConnectionManager) FetchConnections() tea.Msg
- func (cm ConnectionManager) Items() []list.Item
- func (cm ConnectionManager) SaveToDisk() error
- type ConnectionsFetchedMsg
- type Item
Constants ¶
View Source
const ( StorageFileName = "connections.toml" StorageDirPrefix = "ssh-manager" StorageDirPerm = 0755 StorageFilePerm = 0600 )
View Source
const (
DefaultPort = 22
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
func (*Connection) Password ¶
func (c *Connection) Password() (string, error)
func (*Connection) RemovePassword ¶
func (c *Connection) RemovePassword() error
func (Connection) SSHCommand ¶
func (c Connection) SSHCommand() (string, []string, error)
func (Connection) StartSession ¶
func (c Connection) StartSession() error
StartSession starts a new SSH session with the given connection. It will prompt for a password if one was provided, otherwise, it will try to find all available keys in the default paths. TODO: allow custom key paths
func (*Connection) StorePassword ¶
func (c *Connection) StorePassword(password string) error
Store the password in pass
type ConnectionManager ¶
type ConnectionManager struct {
Connections []Connection
}
func (*ConnectionManager) AddConnection ¶
func (*ConnectionManager) DeleteConnection ¶
func (cm *ConnectionManager) DeleteConnection(index int) error
func (ConnectionManager) FetchConnections ¶
func (cm ConnectionManager) FetchConnections() tea.Msg
FetchConnections is a helper function for bubbletea. It fetches the connections from disk, and returns a message. This is useful for loading the model from the Init function.
It returns a ConnectionsFetchedMsg message.
func (ConnectionManager) Items ¶
func (cm ConnectionManager) Items() []list.Item
func (ConnectionManager) SaveToDisk ¶
func (cm ConnectionManager) SaveToDisk() error
Saves the connections as a TOML file in the user config directory
type ConnectionsFetchedMsg ¶
type ConnectionsFetchedMsg struct {
FetchedManager ConnectionManager
}
ConnectionsFetchedMsg is a bubbletea message that is sent when the connections have been fetched from disk.
type Item ¶
type Item struct {
Conn Connection
}
func (Item) Description ¶
func (Item) FilterValue ¶
Click to show internal directories.
Click to hide internal directories.