Documentation ¶
Index ¶
- Constants
- Variables
- func AskForConfirmation(s string) bool
- func AskForSelectItem(s string, ss map[string]string) string
- func ConvertFlags(cmd *cobra.Command, fs []types.Flag) *pflag.FlagSet
- func EnsureFileExist(path, file string) error
- func EnsureFolderExist(path string) error
- func GenerateSSHKey(path string) error
- func GetSSHConfig(username, sshPrivateKeyString, passphrase, sshCert string, password string, ...) (*ssh.ClientConfig, error)
- func NewSpinner(prefix string) *spinner.Spinner
- func RandomToken(size int) (string, error)
- func ReadYaml(path, name string) (i []interface{}, err error)
- func SSHCertificatePath(sshCertPath string) (string, error)
- func SSHPrivateKeyPath(sshKey string) (string, error)
- func UniqueArray(origin []string) (unique []string)
- func UserHome() string
- func WaitFor(fn func() (bool, error)) error
- func WaitForBackoff(fn func() (bool, error), backoff wait.Backoff) error
- func WriteBytesToYaml(b []byte, path, name string) error
- func WriteYaml(source interface{}, path, name string) error
- type KeyPair
Constants ¶
View Source
const ( HomeEnv = "HOME" HomeDriveEnv = "HOMEDRIVE" HomePathEnv = "HOMEPATH" UserProfileEnv = "USERPROFILE" )
View Source
const BashCompEnvVarFlag = "cobra_annotation_bash_env_var_flag"
View Source
const SSHAuthSock = "SSH_AUTH_SOCK"
Variables ¶
View Source
var ( ErrKeyGeneration = errors.New("Unable to generate key") ErrValidation = errors.New("Unable to validate key") ErrPublicKey = errors.New("Unable to convert public key") ErrUnableToWriteFile = errors.New("Unable to write file") )
This file Borrowed from https://github.com/docker/machine/blob/master/libmachine/ssh/keys.go
Functions ¶
func AskForConfirmation ¶
func ConvertFlags ¶ added in v0.3.0
ConvertFlags change autok3s flags to FlagSet, will mark required annotation if possible.
func EnsureFileExist ¶
func EnsureFolderExist ¶
func GenerateSSHKey ¶ added in v0.3.0
GenerateSSHKey generates SSH keypair based on path of the private key The public key would be generated to the same path with ".pub" added
func GetSSHConfig ¶
func NewSpinner ¶
func RandomToken ¶
func SSHCertificatePath ¶
func SSHPrivateKeyPath ¶
func UniqueArray ¶
func WaitForBackoff ¶ added in v0.3.0
func WriteBytesToYaml ¶
Types ¶
type KeyPair ¶ added in v0.3.0
func NewKeyPair ¶ added in v0.3.0
NewKeyPair generates a new SSH keypair This will return a private & public key encoded as DER.
func (*KeyPair) Fingerprint ¶ added in v0.3.0
Fingerprint calculates the fingerprint of the public key
Click to show internal directories.
Click to hide internal directories.