Documentation ¶
Overview ¶
Copyright © 2024 Pone Ding <poneding@gmail.com>
Copyright © 2024 Pone Ding <poneding@gmail.com>
Copyright © 2024 Pone Ding <poneding@gmail.com>
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProfileFile ¶
func CreateProfileFile(file string)
CreateProfileFile creates ssh profile file
Types ¶
type Profile ¶
type Profile struct { Name string `json:"name"` Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` PrivateKey string `json:"privateKey"` Current bool `json:"current"` }
func FormPrompt ¶
func FormPrompt() *Profile
FormPrompt prompts the user to fill in the ssh profile fields, and returns the new profile.
func GetCurrentProfile ¶
func GetCurrentProfile() *Profile
GetCurrentProfile returns the current profile
func NewProfile ¶
func SelectPrompt ¶
func SelectPrompt(label PromptLable) (selected *Profile)
SelectPrompt prompts the user to select a ssh profile, and returns the selected profile.
type PromptLable ¶
type PromptLable string
const ( ConnectPromptLable PromptLable = "Select a ssh profile to connect: " RemovePromptLable PromptLable = "Select a ssh profile to remove: " )
type PromptOperation ¶
type PromptOperation string
const ( AddSSHProfilePromptOperation PromptOperation = "+ Add a new ssh profile" ExitPromptOperation PromptOperation = "✗ Exit" )
Click to show internal directories.
Click to hide internal directories.