This tool allows you to interact with cloud storage services like AWS S3, GCP GCS, and Azure Blob Storage using familiar Linux commands (ls, touch, etc.).
- Current: Supports AWS Localstack with commands ls, touch, rm, rm -r.
- Planned: Additional commands and support for more cloud providers.
This works only on MacOS(Apple Silicon or Intel) now.
Find the latest version and install:
go install github.com/kinshotomoya/go-filesystem/go-filesystem@latest
go-filesystem -mountdir {mountDir} -provider aws -env local -bucket {bucketName}
Example:
go-filesystem -mountdir /tmp/myown-filesystem -provider aws -env local -bucket my-bucket
Navigate and use as usual:
cd /tmp/myown-filesystem
ls -lh
Example:
cd /tmp/myown-filesystem
[]:/tmp/myown-filesystem/ ls -lh
total 32
-rwxrwxrwx 0 root wheel 86B 5 14 08:07 child1.txt
drwxrwxrwx 0 root wheel 22B 5 14 08:07 child2
drwxrwxrwx 0 root wheel 11B 5 14 08:07 child3
-rwxrwxrwx 0 root wheel 219B 5 14 08:07 insert-test-data.sh
Change directory before exiting the go-filesystem process so that the directory is unmounted automatically and successfully. If there is any trouble as unmounting the directory, do it manually
umount {target directory}
Example:
umount /tmp/myown-filesystem/
mount
docker compose up -d
./test-data/insert-test-data.sh
go run go-filesystem/main.go -mountdir /tmp/myown-filesystem -provider aws -env local -bucket my-bucket
MIT License
Feel free to further adjust this to match your project's specifics and add any missing details.
- sample code (access memory file directory)
- docker set up
- fix code to access localstack
- fix code to run ls linux command
ls
- fix code to run other linux command
touch
- fix code to run other linux command
rm
- fix code to run other linux command
mkdir
- fix code to run other linux command
rm -r
- fix code to run other linux command
mv
- unit test / integration test
- fix code to run other linux command
tree
- fix code to access not only localstack but also other cloud storage
- fix code to not display
override rwxrwxrwx root/wheel uchg for hoge.txt?
when removing files that is created on mounted filesystem - fix code to umount directory when kill go process
- not to access to s3 carelessly
- go cli