Skip to content

Additonal Functionality to add on top the existing gin package in go. This allows us to import our version of the package in any microservers we write therefore lowering the amount of code to be re-written.

stevens-tyr/tyr-gin

Repository files navigation

Tyr-Gin

Why?

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.

Features

  1. Logging
  2. JWT
  3. Easy way to add endpoints.

Setup the Environment

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.

Contributing

  1. Clone the repository locally, and create a new branch.
  2. Run go get.
  3. Run go get golang.org/x/tools/cmd/goimports.
  4. Make your changes.
  5. Run make all to fmt, lint, and test code.
  6. Make a merge request.

About

Additonal Functionality to add on top the existing gin package in go. This allows us to import our version of the package in any microservers we write therefore lowering the amount of code to be re-written.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •