Documentation ¶
Index ¶
- Constants
- func AddCache(alias string, keyMap map[string]*models.SSHKey, env *models.Environment) error
- func ClearKey(env *models.Environment)
- func CreateLink(alias string, keyMap map[string]*models.SSHKey, env *models.Environment)
- func DeleteCache(alias string, keyMap map[string]*models.SSHKey, env *models.Environment) error
- func DeleteKey(alias string, key *models.SSHKey, env *models.Environment, forTest ...bool)
- func Execute(workDir, script string, args ...string) bool
- func Fatalf(format string, args ...interface{})
- func GetBakFileName() string
- func IsEmpty(path string) (bool, error)
- func ListCache() error
- func LoadSSHKeys(env *models.Environment) map[string]*models.SSHKey
- func MustGetEnvironment(ctx *cli.Context) *models.Environment
- func ParsePath(path string) string
- func RunHook(alias string, env *models.Environment)
Constants ¶
View Source
const ( // Name is the program name Name = "SKM by Toshiki's Devpedia" // Usage is for simple description Usage = "Manage your multiple SSH keys easily" // CheckSymbol is the code for check symbol CheckSymbol = "\u2714 " // CrossSymbol is the code for check symbol CrossSymbol = "\u2716 " // PublicKey is the default name of SSH public key PublicKey = "id_rsa.pub" // PrivateKey is the default name of SSH private key PrivateKey = "id_rsa" // DefaultKey is the default alias name of SSH key DefaultKey = "default" // HookName is the name of a hook that is called when present after using a key HookName = "hook" )
Variables ¶
This section is empty.
Functions ¶
func ClearKey ¶
func ClearKey(env *models.Environment)
ClearKey clears both private & public keys from SSH key path
func CreateLink ¶
CreateLink creates symbol link for specified SSH key
func DeleteCache ¶
DeleteCache removes SSH key from SSH agent cache via key alias
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf output formatted fatal error info
func GetBakFileName ¶
func GetBakFileName() string
GetBakFileName generates a backup file name by current date and time
func LoadSSHKeys ¶
func LoadSSHKeys(env *models.Environment) map[string]*models.SSHKey
LoadSSHKeys loads all the SSH keys from key store
func MustGetEnvironment ¶
func MustGetEnvironment(ctx *cli.Context) *models.Environment
func RunHook ¶
func RunHook(alias string, env *models.Environment)
RunHook runs hook file after switching SSH key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.