Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Volume and ChangeDir terminology and functions #235

Open
funkyshu opened this issue Mar 10, 2025 · 0 comments
Open

Deprecate Volume and ChangeDir terminology and functions #235

funkyshu opened this issue Mar 10, 2025 · 0 comments
Assignees

Comments

@funkyshu
Copy link
Member

Initial development of vfs tried to constrain functionality to what we could accomplish in all filesystems we could think of (ie., unix os, windows os, AWS S3, Google Storage, Azure Blob storage, SFTP, etc). We decided that when default behaviors between filesystems conflicted, we'd choose the os behavior as pattern we'd most closely follow. Along with this, we borrowed some terminology from os that may not apply everywhere, including File, Volume, ChangeDir. However, as it turns out, that while our use of URI as the means for resource locating has worked extremely well, the terms Volume and ChangeDir are not universally applicable.

Volume

     scheme             host
     __/             ___/____  port
    /  \            /        \ /\
    sftp://[email protected]:22/path/to/file.txt
           \____________________/\_______________/
           \______/       \               \
               /     authority section    path
         username       (Volume)

In the pattern above, for sftp (and ftp) authority is user + host + port. For s3 and gs the authority is a bucket. For mem, namespaces are the optional authority. For os (mainly for windows, unix doesn't distinguish between volumes and directories), it is optionally a volume or mount.

ChangeDir

ChangeDir(relLocPath) is the only place we actually use the term "Dir" (vs Location). It updates the existing Location's path to the provided relative location path. As far as I can see, its behavior is redundant.
We can accomplish the same thing by doing:

// Instead of
err := currentLoc.ChangeDir(relLocPath)

// use
currentLoc, err := currentLoc.NewLocation(relLocPath)

Proposed

  • add Authority() function
  • update all internal references from Volume() to Authority
  • deprecate Volume() function in v7 to be removed in v8.
  • replace all documentation reference to Volume both in public functions and concept be changes to use authority.
  • deprecate ChangDir to be removed in v8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant