Documentation
¶
Index ¶
- func CreateSSHKeyPair(dirName string) (pub, priv string, err error)
- func FindOpenIPs(ips []net.IP, numNeeded int) (openIPs []net.IP, err error)
- func FindUnusedOpenLocalPort(min, max int) (port int, err error)
- func GetSubnetRange(first, last net.IP) (ips []net.IP)
- func LoadAndRunScript(scriptURL, accessToken string, envs map[string]any) (fullCommandlet string)
- func MustLocalIP() string
- func ParseSubnet(cidr string) (firstIP, lastIP net.IP, block *net.IPNet, err error)
- func PingHost(ipAddress string) (pinged bool)
- func SetEnvs(envs map[string]any) (result string)
- func WaitOnline(ipAddress string) (err error)
- func WithKeyboardInteractivePassword(password string) ssh.AuthMethod
- func WithPassword(password string) ssh.AuthMethod
- func WithPrivateKey(key []byte) ssh.AuthMethod
- type SSHConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSSHKeyPair ¶
func FindUnusedOpenLocalPort ¶
func LoadAndRunScript ¶
func MustLocalIP ¶
func MustLocalIP() string
func ParseSubnet ¶
Given a "cidr" string like "10.255.255.0/24", return the first & last usable addresses, the cidr block, and any error encountered.
func WaitOnline ¶
func WithKeyboardInteractivePassword ¶
func WithKeyboardInteractivePassword(password string) ssh.AuthMethod
func WithPassword ¶
func WithPassword(password string) ssh.AuthMethod
func WithPrivateKey ¶
func WithPrivateKey(key []byte) ssh.AuthMethod
Types ¶
type SSHConnection ¶
type SSHConnection struct {
// contains filtered or unexported fields
}
func Connect ¶
func Connect(username, host string, port int, authMethods ...ssh.AuthMethod) (conn *SSHConnection, err error)
func ConnectOnceReadyWithRetry ¶
func ConnectOnceReadyWithRetry(username, host string, port int, retries int, authMethods ...ssh.AuthMethod) (conn *SSHConnection, err error)
func (*SSHConnection) Close ¶
func (conn *SSHConnection) Close() (err error)
func (*SSHConnection) Reset ¶
func (conn *SSHConnection) Reset() (err error)
If you've run a command and want to run another, you need to reset the session
func (*SSHConnection) Send ¶
func (conn *SSHConnection) Send(command string) (err error)
func (*SSHConnection) SendWithOutput ¶
func (conn *SSHConnection) SendWithOutput(command string) (status int, output []byte, err error)
Click to show internal directories.
Click to hide internal directories.