Service to serve information about Administrative Division a country
Try API on cartographer.shajaro.com
Use Go Module for install all dependencies required this application.
Before run this service. Make sure all requirements dependencies has been installed likes Golang, Docker, and database Neo4J
Use command go go run main.go
in root folder for run this application.
cartographer uses docker multi stages build, minimal docker version is 17.05. If docker already installed use command.
This command will build the images.
docker build -f Dockerfile -t cartographer:$(VERSION) .
To run service use this command
docker run --name cartographer -d -e ADDRESS=:8080 -e <environment> $(IMAGE):$(VERSION)
For run unit test, from root project you can go to folder or package and execute command
go test -v -cover -coverprofile=coverage.out -covermode=set
go tool cover -html=coverage.out
go tool
will generate GUI for test coverage. Available package or folder can be tested
/country
/country/handler
/region
/region/handler
/infrastructure/web/handler
SERVER_PORT
- Address application is used default is8080
LOGGER_LEVEL
- Log level(debug, info, error, warn, etc)LOGGER_FORMAT
- Format specific for logtext
- Log format will become standard text output, this used for developmentjson
- Log format will become JSON format, usually used for production
NEO4J_ADDRESS
- Neo4J database addressbolt+routing://<host>:<port>
bolt+routing://
- Used with causal clusterbolt://
- Used with single server
NEO4J_USERNAME
- Neo4J database usernameNEO4J_PASSWORD
- Neo4J database passwordNEO4J_MAX_CONN_POOL
- Neo4j maximum number of connections per URL to allow on this driverNEO4J_ENCRYPTED
- Neo4J whether to turn on/off TLS encryption (true
/false
)NEO4J_LOG_ENABLED
- Neo4J database log enabled (true
/false
)NEO4J_LOG_LEVEL
Neo4J type that default logging implementations use for available default0
0
- Doesn't generate any output1
- Level error2
- Level warning3
- Level info4
- Level debug
This service use GraphQL to serve the request,
- Indonesia - Base on
PMDN 72 TH 2019
, Reference: