sshclient

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PowerOff defines the action of powering off a device
	PowerOff = "poweroff"
	// PowerOn defines the action of powering on a device
	PowerOn = "poweron"
	// PowerCycle defines the action of power cycle a device
	PowerCycle = "powercycle"
	// HardReset defines the action of hard reset a device
	HardReset = "hardreset"
	// Reseat defines the action of power reseat a device
	Reseat = "reseat"
	// IsOn defines the current power status of a device
	IsOn = "ison"
	// PowerCycleBmc  the action of power cycle the bmc of a device
	PowerCycleBmc = "powercyclebmc"
	// PxeOnce  the action of pxe once a device
	PxeOnce = "pxeonce"
)

Variables

This section is empty.

Functions

func IsntLetterOrNumber

func IsntLetterOrNumber(c rune) bool

IsntLetterOrNumber check if the give rune is not a letter nor a number

func Sleep

func Sleep(sleep string) (err error)

Sleep transforms a sleep statement in a sleep-able time

Types

type SSHClient

type SSHClient struct {
	// contains filtered or unexported fields
}

SSHClient implements out commom abstraction for ssh

func New

func New(host string, username string, password string) (connection *SSHClient, err error)

New returns a new configured ssh client

func (*SSHClient) Close

func (s *SSHClient) Close() (err error)

Close closed the ssh connection and ensure to always exit, some vendors will have issues with the bmc if you dont do it

func (*SSHClient) Run

func (s *SSHClient) Run(command string) (result string, err error)

Run execute the given command and returns a string with the output

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL