Sqooba / hdfs

A native go client for HDFS
MIT License
17 stars 5 forks source link

✨ Formatted JSON output with `ls -j` #13

Closed killerwhile closed 6 years ago

killerwhile commented 6 years ago

JSON formatted output with the following structure:

[
    { "name": "/my/hdfs/file/or/folder1", more attributes },
    { "name": "/my/hdfs/file/or/folder2", more attributes },
    ... more file or folders ...
]

Please note that unlike the normal ls command ls -j always uses absolute path and does ignore the -h file size formatting.

Shastick commented 6 years ago

If @a-pagano is happy with this output we can go with this. It's a bit hacky though, we can work on fixing this (ie, with different writers instead of if's peppered around) before doing a PR to the original go-hdfs