Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentConfig ¶
func AgentConfig(u string) (*ssh.ClientConfig, error)
AgentConfig is used to create the SSH Client Configuration when using the SSH Agent for the authentication mechanism
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the remote machine that should be connected to for the transfer. Specifically, what hostname and port.
func NewAgentClient ¶
func NewAgentClient(addr, port string, creds *Credentials) *Client
NewAgentClient creates a new host object that will connect using the SSH Agent signers
func NewKeyClient ¶
func NewKeyClient(addr, port string, creds *Credentials, key *Key) *Client
NewKeyClient creates a new host object that will connect using the SSH Agent signers
func (*Client) Connect ¶
Connect takes the host object and connects, creating an SSH Client connection
func (*Client) ExecuteCommand ¶
ExecuteCommand is used to
func (*Client) ReceiveFileFromRemote ¶
func (c *Client) ReceiveFileFromRemote(remoteFilePath string, remoteFilename string, localFilePath string, localFileName string) error
ReceiveFileFromRemote is used to receive a file using the SCP protocol from a remote host / machine
func (*Client) SendFileToRemote ¶
SendFileToRemote is used to send a file using the SCP protocol to a remote host or machine
func (*Client) VerifyClient ¶
VerifyClient checks if we have a client, and if not attempts to connect
type Credentials ¶
Credentials are the SSH credentials that should be used to connect to the remote host. This is for use with the SSH Agent.
func NewCredentials ¶
func NewCredentials(u, p string) *Credentials
NewCredentials creates a new credential object
type Key ¶
Key represents where an SSH Key should be read from. This is commonly used when the SSH agent is not used.
func NewKey ¶
NewKey is used to create a new SSHKey object and validate that the key file actually exists on the system
type SessionClient ¶
type SessionClient struct {
// contains filtered or unexported fields
}
SessionClient is used to hold the writer for stdout, reader from stdin, wait group for the concurrency, and error channel
func NewSessionClient ¶
func NewSessionClient(s *ssh.Session) (*SessionClient, error)
NewSessionClient creates a new SessionClient structure from the ssh.Session pointer
func (*SessionClient) FileSink ¶
func (c *SessionClient) FileSink(fp, fn string)
FileSink is used to receive a file from the remote machine and save it to the local machine
func (*SessionClient) FileSource ¶
func (c *SessionClient) FileSource(p string)
FileSource allows us to acting as the machine sending a file to the remote host