This is still pretty much WIP, needs more tests (missing integration tests), fixing live tests (they work but will yield inconsistent results, becuase they live).
- protobuf support
- fix docker-compose for integration-test
- fix migration for docker-compose (wait for postgres script)
- add more API test (handler)
- add more unit tests cases (error path)
- cleanup makefile
- fix lint issues
- improve docs
- Docker
- Postgres (for tests)
- Go 1.13+
If you just want to run it, I've created a docker-compose that will install everything for you and start the server.
To start, run:
make start
it will create everything you need and run it.
the server is running on: localhost:4000
caveat: you will need to run migrations (actually rerun the migration container):
docker start migrate
to stop and cleanup:
make stop
in fact, this setup is running in development mode and if you want to devlop the container will refresh itself and compile the bin again. (caveat: sometimes issues with too many concurrent rebuilds and used port)
NOTE:
make stop
runs docker-compose down
, and it will remove the postgres container. the setup is not meant to keep the data of this container.
if you want to test "restarts" you can just restart todos
container :)
The easiest way would be importing the POSTMAN json file that describe the api. Otherwise the api is CRUD using REST:
(assuming you ran it using make start
the host is http://localhost:4000)
GET /todos/?q=
GET /todos/:id
PUT /todos/:id {done: bool, name: string, details: string}
POST /todos {done: bool, name: string, details: string}
DELETE /todos/:id
if you want to devlop locally or run tests. start with
make install
make unit-tests
(Live test are ignored)
TODO