Documentation
¶
Index ¶
- type Option
- func WithBasePath(basePath 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 WithSFTPClient(client *sftp.Client) Option
- func WithUser(user string) Option
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(_ context.Context, key string) error
- func (s *Store) Exists(_ context.Context, key string) (bool, error)
- func (s *Store) Flush(ctx context.Context) error
- func (s *Store) Get(_ context.Context, key string) ([]byte, error)
- func (s *Store) GetRange(_ context.Context, key string, offset, length int64) ([]byte, error)
- func (s *Store) List(_ context.Context, prefix string) ([]string, error)
- func (s *Store) Put(_ context.Context, key string, data []byte) error
- func (s *Store) Size(_ context.Context, key string) (int64, error)
- func (s *Store) TotalSize(_ context.Context) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option configures an SFTP store.
func WithBasePath ¶
WithBasePath sets the root directory on the SFTP server.
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.
func WithSFTPClient ¶
WithSFTPClient provides a pre-configured SFTP client, skipping internal connection setup. When set, server and auth options are ignored.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements store.ObjectStore backed by an SFTP server.
func New ¶
New creates an SFTP-backed store for the given host. Either WithSFTPClient or authentication options must be provided. The base path directory is created if it does not exist.
Click to show internal directories.
Click to hide internal directories.