Code Monkey home page Code Monkey logo

go-filesystem's Introduction

go-filesystem

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 features:

  • Current: Supports AWS Localstack with commands ls, touch, rm, rm -r.
  • Planned: Additional commands and support for more cloud providers.

important

This works only on MacOS(Apple Silicon or Intel) now.

Installation

1. Install FUSE

https://osxfuse.github.io/2024/04/05/macFUSE-4.7.0.html

2. Install the Binary

Find the latest version and install:

go install github.com/kinshotomoya/go-filesystem/go-filesystem@latest

3. Mount Directory

go-filesystem -mountdir {mountDir} -provider aws -env local -bucket {bucketName}

Example:

go-filesystem -mountdir /tmp/myown-filesystem -provider aws -env local -bucket my-bucket

4. Use the Filesystem

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

5. Unmount the Directory

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/

Development

Verify Mounted Filesystems

mount

Run localstack on docker-compose

docker compose up -d

Setup Local Test Data

./test-data/insert-test-data.sh

Run go-filesystem

go run go-filesystem/main.go -mountdir /tmp/myown-filesystem -provider aws -env local -bucket my-bucket

License

MIT License

Feel free to further adjust this to match your project's specifics and add any missing details.

Tasks

  • 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

go-filesystem's People

Contributors

kinshotomoya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.