Documentation
¶
Index ¶
- type Option
- func WithBasePath(basePath string) Option
- func WithClient(client *sftp.Client) Option
- func WithExcludePatterns(patterns []string) Option
- func WithHostKeyCallback(cb ssh.HostKeyCallback) Option
- func WithKey(keyPath string) Option
- func WithKnownHosts(path string) Option
- func WithPassword(password string) Option
- func WithPort(port string) Option
- func WithUser(user string) Option
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*sftpOptions)
Option configures an SFTP filesystem source.
func WithBasePath ¶
WithBasePath sets the root directory on the SFTP server.
func WithClient ¶
WithClient provides a pre-configured SFTP client, skipping internal connection setup. When set, server and auth options are ignored.
func WithExcludePatterns ¶
WithExcludePatterns sets the patterns used to exclude files and folders.
func WithHostKeyCallback ¶
func WithHostKeyCallback(cb ssh.HostKeyCallback) Option
WithHostKeyCallback sets the host key verification callback.
func WithKnownHosts ¶
WithKnownHosts sets the path to the known_hosts file.
func WithPassword ¶
WithPassword sets password authentication.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source implements Source for a remote SFTP filesystem.
func New ¶
New creates an SFTP-backed source for the given host. Either WithClient or authentication options must be provided, along with WithBasePath.
func (*Source) GetFileStream ¶
func (s *Source) GetFileStream(fileID string) (io.ReadCloser, error)
func (*Source) Info ¶
func (s *Source) Info() source.SourceInfo