Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

tweak the Ls interface #14

Merged
merged 6 commits into from
Mar 7, 2019
Merged

tweak the Ls interface #14

merged 6 commits into from
Mar 7, 2019

Conversation

Stebalien
Copy link
Member

  1. Avoid ipld.Link. This is a protodag specific thing that will go away in future IPLD versions.
  2. Avoid exposing the underlying file types. The user shouldn't care if they're dealing with a hamt, etc.
  3. Add a field for a symlink's target.
  4. Rename LsLink to DirEntry to better this type's role.

@Stebalien Stebalien requested a review from magik6k March 5, 2019 04:14
@Stebalien
Copy link
Member Author

Thoughts @magik6k?

1. Avoid `ipld.Link`. This is a protodag specific thing that will go away in
   future IPLD versions.
2. Avoid exposing the underlying file types. The user shouldn't care if they're
   dealing with a hamt, etc.
3. Add a field for a symlink's target.
4. Rename LsLink to DirEntry to better this type's role.
Stebalien added a commit to ipfs/kubo that referenced this pull request Mar 5, 2019
See: ipfs/interface-go-ipfs-core#14

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Copy link
Member

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

unixfs.go Outdated
// Only filled when asked to resolve the directory entry.
Size uint64 // The size of the file in bytes (or the size of the symlink).
Type FileType // The type of the file.
Target Path // The symlink target (if a symlink).
Copy link
Member

@magik6k magik6k Mar 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a test (and we should probably expose it via ipfs ls as otherwise it will need to call multiple endpoints to implement fully in http-client)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. I've added tests.

@Stebalien Stebalien force-pushed the feat/nicer-ls branch 2 times, most recently from 0124bd8 to 8c2328a Compare March 5, 2019 17:55
Stebalien added a commit to ipfs/kubo that referenced this pull request Mar 5, 2019
See: ipfs/interface-go-ipfs-core#14

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
(path can't represent relative paths)
Stebalien added a commit to ipfs/kubo that referenced this pull request Mar 5, 2019
See: ipfs/interface-go-ipfs-core#14

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien
Copy link
Member Author

I've also:

  1. Added a stringer to the file types.
  2. Switched to a string instead of a Path as paths don't support relative paths, unfortunately.

Stebalien added a commit to ipfs/kubo that referenced this pull request Mar 5, 2019
See: ipfs/interface-go-ipfs-core#14

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien Stebalien requested a review from magik6k March 7, 2019 00:03
Stebalien added a commit to ipfs/kubo that referenced this pull request Mar 7, 2019
See: ipfs/interface-go-ipfs-core#14

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
It's complicated. We need to carefully think through how sizes work.
Stebalien added a commit to ipfs/kubo that referenced this pull request Mar 7, 2019
See: ipfs/interface-go-ipfs-core#14

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien
Copy link
Member Author

@magik6k I've had to make some changes. Can you take another look?

@Stebalien Stebalien merged commit 3482625 into master Mar 7, 2019
@Stebalien Stebalien deleted the feat/nicer-ls branch March 7, 2019 19:04
Stebalien added a commit to ipfs/kubo that referenced this pull request Mar 7, 2019
See: ipfs/interface-go-ipfs-core#14

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants