@Author Stefano Mantini
- Implements the Create, Fetch, List (inc paging) and Delete operations on the accounts resource.
- Has 60%+ unit test coverage
- Runs on docker-swarm
- Has 0 non-test dependencies
- Is written in go
- Uses go modules
- Full usage documented in main.go
- main.go runs example api requests every 10 seconds against the api
./build.sh
-> builds the container with the appropriate tagsdocker-compose up -d
-> runs the ensemble
./build.sh
-> builds the container with the appropriate tagsdocker-compose up -d
-> runs the supporting services./docker-run.sh
-> runs the test service, (having removed the test service from compose file)
./coverage
-> runs coverage stats (excluding main.go)- Ensure the following environment properties are set (service will exit if they are not)
- export SERVER_PORT=9000
- export API_PROTOCOL=http
- export API_HOST=127.0.0.1
- export API_PORT=8080
- export API_VERSION=1
./run.sh
- Remove main.go! Replace with godog for integration tests
- Move package structure to a more domain-driven design (all models and interfaces defined in account.go) and separate files implementing behaviours, apprehensive as there's some custom types implemented at the top level
- Run tests, fmt, vet staticcheck in pipeline
- Custom type & validator for bankIdCode
- Implement a logger on the accountClient struct and log.Debug in/out of methods and on error
- Move custom types into separate modules with their own
go.mod
files respectively for reuse across different packages - Refactor countries type to use a struct to handle more attributes (the current setup only supports storing 2 digit country codes against the country)
- Run container as non-root & convert to using base alpine
- Upgrade to go v1.15 (works local, but had some issues when running on alpine)