Author: Thyago Clemente
The goal of this project is to provide a Web Service with a RESTful API for clients to run algorithms and perform updates on directed graphs.
The project contains a docker folder containing a docker-compose.yml ready to run the project. It includes a MySQL database container (db), a container to run the API (directedgraph) and a container to execute tests (directedgraph_test).
To run the API together with the database, execute:
docker-compose --profile dev up
To run only the tests together with the database, execute:
docker-compose --profile test up
First setup the required environment variables:
ENV VARIABLE | DESCRIPTION | DEFAULT |
---|---|---|
DB_USER | MySQL Username | |
DB_PASSWORD | MySQL Password | |
DB_HOST | MySQL Host | |
DB_PORT | MySQL Port | 3306 |
DB_NAME | MySQL Database Name | |
SERVER_PORT | API Server Default Port | 8080 |
Then run it from the root directory:
go run main.go
To run the unit tests, execute
go test --tags=unit -v ./...
To run the integration tests, execute
go test --tags=integration -v ./...
An OpenAPI (Swagger) specification is not yet in the project.
Check APIDOC_TEMP.md for the temporary documentation.
Current version uses /v1
prefix for all endpoints.
See ATTRIBUTIONS.md
The MIT License (MIT)
Copyright (c) 2021 Thyago Clemente
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.