Code Monkey home page Code Monkey logo

golang-gin-gorm-starter's Introduction

Golang Gin GORM starter

This repository contains a starter template for rapid microservice development with Go. It uses Gin and GORM.

Installation

  • Get the repository from GitHub
git clone [email protected]:henvo/golang-gin-gorm-starter.git
  • Install dependencies
go get
  • Run app
go run main.go

Things to consider

  • Rename all instances of github.com/henvo/golang-gin-gorm/ to your package
  • Switch from the default database driver (mysql) to sqlite, postgresql, ...

Env variables

  • PORT (Default: 8080)
  • GIN_MODE (Default: debug)
  • DATABASE_HOST (Default: localhost:3306)
  • DATABASE_NAME (Default: go_test)
  • DATABASE_USERNAME (Default: golang)
  • DATABASE_PASSWORD (Default: golang)

golang-gin-gorm-starter's People

Contributors

henvo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

golang-gin-gorm-starter's Issues

Possible memory build up

DISCLAIMER: I am fairly new to go, so I may be missing something here.

As pointed in this gorm issue, if you don't close the connection to the database, a new goroutine is created everytime you query the database. I have seen this via the comment on gorm's website of the same person who started given issue.

Using statsviz, I tested it myself (not through this repo) and goroutines created are staying there until the program is terminated.

You may want to check this usage on gorm's website and opt to close the connection after use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.