Documentation ¶
Overview ¶
Package ssh implements various CoreOS and etcd related commands executed via SSH.
By default a shellout to ssh is done, which utilizes the users ssh-agent and normal ssh configuration.
Index ¶
- Variables
- func GetEtcd2MemberName(host string) (string, error)
- func GetEtcdDiscoveryUrl(host string) (string, error)
- func GetMachineID(host string) (string, error)
- func RemoveFromEtcd(host string) error
- func RunRemoteCommand(host, command string) (string, error)
- func StopEtcd(host string) error
- type Executor
- type SSHShellExecutor
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultExecutor is an SSHShellExecutor with some default values. DefaultExecutor = &SSHShellExecutor{ Username: "core", Binary: "ssh", } )
Functions ¶
func GetEtcd2MemberName ¶
GetEtcd2MemberName connects to the given host and returns the name of the given host in the etcd2 quorum. This assumes the member has "name=<machine-id>" set.
func GetEtcdDiscoveryUrl ¶
GetEtcdDiscoveryUrl connects to the given host and extracts the used etcd discovery URL.
func GetMachineID ¶
GetMachineID connects to the given host and returns the content of /etc/machine-id.
func RemoveFromEtcd ¶
RemoveFromEtcd connects to the given host and removes it from the etcd discovery.
Utilizes GetMachineID()
func RunRemoteCommand ¶
RunRemoteCommand executes the given command using the DefaultExecutor.
Types ¶
type Executor ¶
Executor is responsible for executing the given command on the given host and returning its output.
type SSHShellExecutor ¶
SSHShellExecutor provides an Executor using os.Exec to utilize the command line tool ssh.
func (*SSHShellExecutor) RunRemoteCommand ¶
func (ssh *SSHShellExecutor) RunRemoteCommand(host, command string) (string, error)
RunRemoteCommand connects to the given host and runs the command, returning any output.