Documentation ¶
Overview ¶
Package pulley is a wrapper around the golang.org/x/crypto/ssh package providing a suckless experience.
Index ¶
- type Client
- func (s *Client) Connect() error
- func (s *Client) Exec(cmd string) Result
- func (s *Client) ExecAsync(cmd string, rc chan Result)
- func (s *Client) ExecAsyncErr(cmd string, rc chan Result)
- func (s *Client) ExecErr(cmd string) Result
- func (s *Client) LoadDefaultKey() error
- func (s *Client) LoadKey(key []byte) error
- func (s *Client) Session() (*ssh.Session, error)
- func (s *Client) Ugly() (*ssh.Client, *ssh.ClientConfig)
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { HostName string Port string User string // contains filtered or unexported fields }
Client is the client for the ssh connection and the primary way to interact with pulley.
func New ¶
New creates a default Client. Modify this client via it's public members, HostName, Port, and User. These default to localhost, 22, and the current user running the process.
func (*Client) Connect ¶
Connect will connect the client to it's hostname and port, if LoadKey or LoadDefaultKey have not been called yet this will call LoadDefaultKey
func (*Client) Exec ¶
Exec runs the command on the server that's connected to by this client, if It will handle sessions automatically and return a pulley.Result
func (*Client) ExecAsync ¶
ExecAsync is the same as exec however will execute in a go routine and takes a channel which it will send the result over.
func (*Client) ExecAsyncErr ¶
ExecAsyncErr is the same as ExecAsync however the result's output will have both stderr and stdout.
func (*Client) ExecErr ¶
ExecErr is the same as exec however the result's output will have both stdout and stderr.
func (*Client) LoadDefaultKey ¶
LoadDefaultKey will load the ssh key at $HOME/.ssh/id_rsa
type Result ¶
type Result struct { Output []byte // contains filtered or unexported fields }
Result represents the result of a command executed via SSH