The purpose of this is to centralize some features common to a gin service that we might use in our microservices. This way each microservice does not need to re-implement features. Such as jwt functions, logging and etc.
- Logging
- JWT
- Easy way to add endpoints.
The following environmental variables are used:
MONGO_URI=<URI OF MongoDB> DB_NAME=<Name of Database to use> LOG_FILE=<Name of log file (log.json by default)> JWT_SECRET=<Secret used for JWT encryption> JWT_REALM=<Realm for JWT (different for prod/dev)>
Within this repo, there is an example .env file that is used for testing purposes, when using this package, place a .env file within the root folder where you setup the router.
- Clone the repository locally, and create a new branch.
- Run go get.
- Run go get golang.org/x/tools/cmd/goimports.
- Make your changes.
- Run make all to fmt, lint, and test code.
- Make a merge request.