Documentation
¶
Index ¶
- func CopyStream(ctx context.Context, destination io.Writer, source io.Reader, size int64, ...) (int64, string, error)
- func ExplicitSFTPRejection(err error) bool
- func IsPermissionDenied(err error) bool
- func IsRootPath(cleaned string) bool
- func NormalizeSFTPPath(p string) string
- type Client
- type CommitResult
- type Metadata
- type Remote
- type Session
- func (r *Session) Close() error
- func (r *Session) Commit(ctx context.Context, temporary, destination string, overwrite bool) (result CommitResult, retErr error)
- func (r *Session) Download(ctx context.Context, expected Metadata, destination io.Writer, ...) (result StreamResult, retErr error)
- func (r *Session) Inspect(ctx context.Context, name string, upload, overwrite bool) (metadata Metadata, retErr error)
- func (r *Session) Remove(ctx context.Context, name string) error
- func (r *Session) Upload(ctx context.Context, temporary string, source io.Reader, size int64, ...) (result StreamResult, retErr error)
- type StreamResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyStream ¶
func ExplicitSFTPRejection ¶ added in v0.16.0
ExplicitSFTPRejection reports whether err is a definitive SFTP server status indicating the target operation was rejected without mutating the path.
func IsPermissionDenied ¶ added in v0.16.0
IsPermissionDenied reports whether err is an OS or SFTP permission-denied status.
func IsRootPath ¶ added in v0.16.0
IsRootPath reports whether p represents a POSIX or Windows drive root directory.
func NormalizeSFTPPath ¶ added in v0.16.0
NormalizeSFTPPath converts Windows drive paths (C:\..., c:/..., /C:\...) into OpenSSH SFTP canonical form (/C:/...) with an uppercase drive letter and forward slashes. Non-drive POSIX paths are cleaned without altering backslashes.
Types ¶
type Client ¶
type Client interface {
Do(context.Context, func(*pkgsftp.Client) error) error
CreatePrivateExclusive(context.Context, string, func(io.Writer) error) (bool, bool, error)
Close() error
}
Client is the existing SFTP capability used by the streaming adapter.
type CommitResult ¶
type Remote ¶
type Remote interface {
Inspect(context.Context, string, bool, bool) (Metadata, error)
Upload(context.Context, string, io.Reader, int64, func() error, func(int64) error) (StreamResult, error)
Download(context.Context, Metadata, io.Writer, func(int64) error) (StreamResult, error)
Commit(context.Context, string, string, bool) (CommitResult, error)
Remove(context.Context, string) error
Close() error
}
Remote owns a dedicated SFTP subsystem. Readers/writers supplied by HTTP must have rolling deadlines and cancellation-driven I/O interruption.