- To build source code and rebuild docker image
cd src code directory (cd simple-file-server)
go get "github.com/gorilla/mux"
go get "gopkg.in/mgo.v2"
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server .
- Build docker image
git clone https://github.com/supnobita/simple-file-server/
cd simple-file-server
docker build -t simple-file-server:v1 .
- Run container
cd src code directory (cd simple-file-server)
docker-compose up -d
- Read file: filename.txt:
curl http://127.0.0.1:8080/read?file=filename.txt
- Write file: filename.txt:
curl --form [email protected] http://localhost:8080/upload
- Delete file: filename.txt
curl http://127.0.0.1:8080/delete?file=filename.txt
=======
Enormous Limitations !!!!
- single thread
- search file (database)
- deduplication method
- error handler
- foreground job
- write,read speed