Documentation
¶
Overview ¶
Package factory provides filesystem creation and connection management. It handles instantiation of local and remote (SFTP) filesystems with proper authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultConnector ¶
type DefaultConnector struct{}
DefaultConnector is the production implementation of FileSystemConnector.
func (*DefaultConnector) CreateHostKeyCallback ¶
func (c *DefaultConnector) CreateHostKeyCallback() (sshx.HostKeyCallback, error)
func (*DefaultConnector) NewLocalFS ¶
func (c *DefaultConnector) NewLocalFS() core.FileSystem
func (*DefaultConnector) NewRemoteFS ¶
func (c *DefaultConnector) NewRemoteFS(opts ssh.SSHConfig) (core.FileSystem, error)
func (*DefaultConnector) ReadPassword ¶
func (c *DefaultConnector) ReadPassword() (string, error)
type FileSystemConnector ¶
type FileSystemConnector interface {
NewLocalFS() core.FileSystem
NewRemoteFS(opts ssh.SSHConfig) (core.FileSystem, error)
ReadPassword() (string, error)
CreateHostKeyCallback() (sshx.HostKeyCallback, error)
}
FileSystemConnector defines the interface for creating file systems.
type RemoteInfo ¶
RemoteInfo contains information about a remote connection
func CreateFileSystem ¶
func CreateFileSystem(remoteStr string, args []string) (core.FileSystem, *RemoteInfo, error)
CreateFileSystem instantiates a LocalFS or RemoteFS based on the remote string.
func CreateFileSystemWithConnector ¶
func CreateFileSystemWithConnector(remoteStr string, args []string, conn FileSystemConnector) (core.FileSystem, *RemoteInfo, error)
CreateFileSystemWithConnector allows injecting a custom connector for testing.
Click to show internal directories.
Click to hide internal directories.