Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(protocolName string, factory NewRemoteClientFunc)
Register registers a remote client new func for the given protocol name.
Types ¶
type NewRemoteClientFunc ¶
type NewRemoteClientFunc func(config NodeConfig) (RemoteClient, error)
NewRemoteClientFunc defines the signature for creating a new RemoteClient.
type NodeConfig ¶
NodeConfig contains the configuration needed to connect to a remote node
type RemoteClient ¶
type RemoteClient interface {
// RunCommand executes a command on the remote machine
RunCommand(ctx context.Context, command string, stdout io.Writer, stderr io.Writer) error
// Download copies a file from the remote path to a local path
Download(ctx context.Context, remotePath, localPath string) error
// Upload copies a file from the local path to a remote path
Upload(ctx context.Context, localPath, remotePath string) error
// Dial opens a connection to the given network and address on the remote machine.
Dial(network, address string) (net.Conn, error)
// Close terminates the connection to the remote machine.
Close() error
}
RemoteClient defines an interface for interacting with a remote machine. This abstraction allows for swapping the underlying client implementation
func GetClient ¶
func GetClient(protocolName string, config NodeConfig) (RemoteClient, error)
GetClient is called by executors to get a client for a specific protocol.
Click to show internal directories.
Click to hide internal directories.