Skip to content

Proposal: io/fs presents us an opportunity to rework the whole api into a v2 #407

@puellanivis

Description

@puellanivis

Most of the proposal is right there in the title. What with io/fs being rolled out in go1.16, we have a big opportunity to remodel, simplify, and rework our API. Current issues, as I see them:

  • The current sftp.Client implements github.com/kr/fs, but we could switch to model more compatible with io/fs.FS
  • The in-memory test filesystem cannot be removed from the main package without a breaking change, ideally if kept, this should be a subpackage.
  • The ErrSshFxXyz errors are still around, because they cannot be removed without a breaking change.
  • The RequestServer and Server implementations are significantly different and almost parallel implementations.
  • The RequestServer could be better implemented via a base interface with additional extension interfaces. (à la io/fs)
  • From an earlier discussion, many of the raw implementation concepts of the protocol itself could be isolated into its own subpackage, providing a better separation of responsibilities.
  • Some features can be reassessed for utility, and either properly folded into functionality without needing feature flags (like the allocator?) or dropped entirely (we could switch WriteTo so that it does not depend upon filesizes, thus saving us the need of an UseFstat() option).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions