Documentation ¶
Index ¶
- type SSH
- func (s *SSH) Close()
- func (*SSH) Connect(target *types.Target, cred *types.Credential) (Transport, error)
- func (s *SSH) Do(cmd []string) (stdout []byte, stderr []byte, result int, err error)
- func (s *SSH) DoInput(cmd []string, stdin []byte) (stdout []byte, stderr []byte, result int, err error)
- func (s *SSH) DoReader(cmd []string, stdin io.Reader) (stdout []byte, stderr []byte, result int, err error)
- type Transport
- type TransportConnect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SSH ¶
type SSH struct { Address string Username string Port int32 Password string // contains filtered or unexported fields }
func (*SSH) Connect ¶
Connect is "static," in that it does not reference the receive it's called on; so it can be called on a nil pointer to SSH. This is good, because it's a sort of constructor to create a live SSH connection. Thus, it returns an SSH connection to the given target authenticated with the given credential; or an error, if something went wrong.
type Transport ¶
type Transport interface { // Do performs a command via the configured transport, probably on a target host. The first element in cmd // should be the binary; the rest will be individual arguments, properly escaped... Do(cmd []string) (stdout []byte, stderr []byte, result int, err error) DoInput(cmd []string, stdin []byte) (stdout []byte, stderr []byte, result int, err error) DoReader(cmd []string, stdin io.Reader) (stdout []byte, stderr []byte, result int, err error) Connect(target *types.Target, credential *types.Credential) (Transport, error) Close() }
type TransportConnect ¶
Click to show internal directories.
Click to hide internal directories.