All Projects → Mindinventory → Golang Project Structure

Mindinventory / Golang Project Structure

Licence: mit
Golang Skeleton with fully version managed

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Golang Project Structure

Valine
A fast, simple & powerful comment system.
Stars: ✭ 1,899 (+1743.69%)
Mutual labels:  easy-to-use
Goilerplate
Clean Boilerplate of Go, Domain-Driven Design, Clean Architecture, Gin and GORM.
Stars: ✭ 173 (+67.96%)
Mutual labels:  gorm
Go Mocket
Go GORM & SQL mocking library
Stars: ✭ 190 (+84.47%)
Mutual labels:  gorm
Ether.network
https://github.com/Eastrall/Sylver
Stars: ✭ 147 (+42.72%)
Mutual labels:  easy-to-use
Cmall Go
golang写的电子商城的API接口
Stars: ✭ 167 (+62.14%)
Mutual labels:  gorm
Golang Html To Pdf Converter
Golang HTML to PDF Converter
Stars: ✭ 177 (+71.84%)
Mutual labels:  easy-to-use
Gosql
golang orm and sql builder
Stars: ✭ 141 (+36.89%)
Mutual labels:  gorm
Django Easy Timezones
Easy timezones for Django based on GeoIP
Stars: ✭ 195 (+89.32%)
Mutual labels:  easy-to-use
Easywall
Web interface for easy use of the IPTables firewall on Linux systems written in Python3.
Stars: ✭ 172 (+66.99%)
Mutual labels:  easy-to-use
Overlap Image Gallery View
OverlapImageGalleryView with different animations. Sample for android mobile application.
Stars: ✭ 188 (+82.52%)
Mutual labels:  easy-to-use
Pwn debug
Aim to help building exploitation of CTFs pwn game quickly
Stars: ✭ 149 (+44.66%)
Mutual labels:  easy-to-use
Brain.js
brain.js is a GPU accelerated library for Neural Networks written in JavaScript.
Stars: ✭ 12,358 (+11898.06%)
Mutual labels:  easy-to-use
Go init
一个用go组织项目结构,主要包括 gin, goredis, gorm, websocket, rabbitmq等。👉
Stars: ✭ 183 (+77.67%)
Mutual labels:  gorm
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (+41.75%)
Mutual labels:  easy-to-use
Grails Data Mapping
GORM - Groovy Object Mapping
Stars: ✭ 194 (+88.35%)
Mutual labels:  gorm
Ptemplate
A personal website template that's not a pain in the ass to setup and use
Stars: ✭ 143 (+38.83%)
Mutual labels:  easy-to-use
Quick.db
An easy, open-sourced, Node.js database designed for complete beginners getting into the concept of coding.
Stars: ✭ 177 (+71.84%)
Mutual labels:  easy-to-use
Easy.messagehub
No need for .NET Events! A thread-safe, high performance & easy to use cross platform implementation of the Event Aggregator Pattern.
Stars: ✭ 208 (+101.94%)
Mutual labels:  easy-to-use
Fuckdb
From database generate go struct,help you fuck db fields
Stars: ✭ 195 (+89.32%)
Mutual labels:  gorm
Heroku Telegram Bot
Starter pack to host your Python Telegram Bot on Heroku for free.
Stars: ✭ 183 (+77.67%)
Mutual labels:  easy-to-use

Go Project Structure

This is a sample structure for managing Go projects which provides versioning for REST APIs. This repository has following packages which makes it useful while creating your first GO project.

  • gorm : It is the ORM library in Go which provides user friendly functions to interact with database. It supports features like ORM, Associations, Hooks, Preloading, Transaction, Auto Migration, Logger etc.
  • gin : Gin is a web framework for Go language. Here gin is used for increase performance and productivity.
  • godotenv : Basically used for load env variables from .env file.
  • mysql : It provides the mysql driver for connecting Go with MySQL.

STRUCTURE

Directories

1. ApiHelpers

Basically contains the helper functions used in returning api responses, HTTP status codes, default messages etc.

2. Controllers

Contains handler functions for particular route to be called when an api is called.

3. Helpers

Contains helper functions used in all apis

4. Middlewares

Middleware to be used for the project

5. Models

Database tables to be used as models struct

6. Resources

Resources contains all structures other than models which can be used as responses

7. Routers

Resources define the routes for your project

8. Seeder

It is optional, but if you want to insert lots of dummy records in your database, then you can use seeder.

9. Services

All the core apis for your projects should be within services.

10. Storage

It is generally for storage purpose.

11. Templates

Contains the HTML templates used in your project

12. .env

Contains environment variables.

Pre-requirements before starting your first go projects

. Install latest version of go i.e 1.12 (Released in Feb 2019) . Setup GOROOT and GOPATH

RUN THE SERVER (Basic commands)

. For running the server you have to run following command go run main.go It will start your server at the port you have mentioned in .env file.

. If you want to run the server in port other than default, then run following command go run main.go <specific port>

. If you want to create a build for your project and upload in server, then you have to run following command go build

API with versioning

For using version 1 api

127.0.0.1:8099/api/v1/user-list

For using version 2 api

127.0.0.1:8099/api/v2/user-list

LICENSE!

CoverFlow is MIT-licensed

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding our work.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].