Documentation ¶
Index ¶
- func AddPublicKeyToRemoteNode(host string, port int32, username string, password string, publicKey []byte) error
- func GenerateSSHKeyPair() (private []byte, public []byte, err error)
- func SetupPrivateKeyAccess(machine MachineParams, privateKey []byte, publicKey []byte) error
- type BatchRunner
- type Client
- type ClusterParams
- type Cmd
- type ErrorCmd
- type MachineParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPublicKeyToRemoteNode ¶
func AddPublicKeyToRemoteNode(host string, port int32, username string, password string, publicKey []byte) error
AddPublicKeyToRemoteNode will add the publicKey to the username@host:port's authorized_keys file w/password
func GenerateSSHKeyPair ¶
GenerateSSHKeyPair creates a ECDSA a x509 ASN.1-DER format-PEM encoded private key string and a SHA256 encoded public key string
func SetupPrivateKeyAccess ¶
func SetupPrivateKeyAccess(machine MachineParams, privateKey []byte, publicKey []byte) error
Types ¶
type BatchRunner ¶
type BatchRunner struct {
// contains filtered or unexported fields
}
BatchRunner is used for running multiple ssh commands on a single client.
func NewBatchRunner ¶
func NewBatchRunner(c *Client, out io.Writer) *BatchRunner
func (*BatchRunner) Err ¶
func (b *BatchRunner) Err() error
func (*BatchRunner) Run ¶
func (b *BatchRunner) Run(cmds ...Cmd)
Run executes all the commands on the client. If any of the commands return an error then all remaining commands will be skipped. You can check the error with BatchRunner.Err(). Stdout and Stderr from the command are interleaved and are written to the BatchRunners output.
type Client ¶
Client contains the underlying net.Conn and an ssh.Client for the conn.
type ClusterParams ¶
type ClusterParams struct { Name string PrivateKey string // These are base64 _and_ PEM encoded Eliptic PublicKey string // Curve (EC) keys used in JSON and YAML. K8SVersion string ControlPlaneNodes []MachineParams WorkerNodes []MachineParams }
ClusterParams contains parameters for the entire cluster.
type Cmd ¶
func CommandWithInput ¶
CommandWithInput is a convenience method to create Cmd that takes input from a supplied io.Reader.