Skip to content

bankierubybank/golang-gin

Repository files navigation

My Golang Gin Sample API

CI Build Status

This project is for learning Golang (with Gin-gonic)

  • How to write sample API with Golang
  • How to Dockerize Golang application
  • How to CI using GitHub Actions / Azure DevOps Pipeline
  • How to deploy Golang container on Docker and K8s/OpenShift (On-premise and Cloud)
Environment Variable
Variable name Description Default Mandatory
PORT Application Port 8080 YES

Setup (Docker) - Pull my image

docker push bankierubybank/golang-gin:latest
docker run --name my-golang-gin -d -p 80:8080 bankierubybank/golang-gin:latest

Setup (Docker) - Build From Source

docker build -t golang-gin:latest .
docker run --name my-golang-gin -d -p 80:8080 golang-gin:latest

Swagger

http://<HOST-IP>:<PORT>/swagger/index.html
API Routes
Method Route Purpose
GET /api/v1/users List users
GET /api/v1/users/{id} Get an user by ID
POST /api/v1/users Create an user from provided JSON
GET /api/v1/debug Get debug information
GET /api/v1/debug/execute/{cmd} Execute command and return result

About

Just repo for learning Golang

Resources

Stars

Watchers

Forks

Packages

No packages published