Go microservice that allows registered users to store files.
- Use store interface which allows for easy mock testing
- Seperate struct for configs used to instantiate service
- Vendored dependencies
- JWT session validation
- Authorization data set in request context
- Register
- Login
- List files
- Put file
- Get file
- Delete file
From root folder:
go build && ./simple-storage-server
Localhost address is http://localhost:9999/
Expected file form field is "file"
go test
- Handle space limitations
- More test coverage
- Store registered users to disk
- Create and cleanup folders on startup
- Logger middleware
- Integration tests
- Read configs from text file
- Docker image
- Publish API
What's the big deal with microservices?
With clouds, we can finally decouple data and the logic that goes with them across infrastructure. Just imagine your working code stays up. When something goes wrong, only one service goes down. It's a beautiful dream. The cost is the heavy lifting of configuring, monitoring, and complicating your system.
Serverless lambda functions are the next logical step. But it's not necessary to be extreme about any paradigm. With services, the ends is more important than the means.