Provides REST API for CRUD operations on payment entities
Application expects configuration provided as environment variables, available vars:
PORT
- app listen port, default8000
MONGO_URL
- URL to mongodb, requiredMONGO_DB_NAME
, defaultpayments
MONGO_COL_NAME
, defaultpayments
MONGO_TIMEOUT
, default100ms
GIN_MODE
, defaultdebug
The easies way to start the app is to follow steps:
docker-compose up -d
; starts mongodb serverdep ensure
; installs dependenciesMONGO_URL=mongodb:https://root:example@localhost:27017/admin go run main.go
; starts app on port 8000
To stop mongo docker-compose stop
To stop and remove container (and remove data) docker-compose down
To run acceptance tests follow steps:
docker-compose up -d
; starts mongodb serverdep ensure
; installs dependenciesMONGO_URL=mongodb:https://root:example@localhost:27017/admin MONGO_DB_NAME=payments_test go test
; runs tests usingpayments_test
database
API specification can be found in api/openapi.yml
and viewed with https://editor.swagger.io/