Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/dean2032/go-project-layout

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/dean2032/go-project-layout

  • v0.0.0-20221115170540-e345738a9fe2
  • Source
  • Go
  • Socket score

Version published
Created
Source

go project layout

This is a simple clean architecture template with gin framework, fx as dependency container, gorm as orm for database related operations.

Implemented Features

  • Dependency Injection (go-fx)
  • Routing (gin web framework)
  • Logging provides context trace(trace_id) and log file rotation (zap and lumberjack)
  • Gin middlewares setup (cors, zap logger with custom log format)
  • Database Setup (mysql)
  • Models Setup and Automigrate (gorm with zap logger)
  • Authentication (JWT)
  • Migration Runner Implementation
  • Cobra Commander CLI Support. try: go run . --help
  • Pprof setup with gin

Running the project

  • Make sure you have go and git installed.
  • Clone and build app:
    $ go clone https://github.com/dean2032/go-project-layout.git
    $ cd go-project-layout
    $ go build -o app
    
  • Run a subcommand of app. Two subcommands are provided:
    • file_server: this subcommand will run a file download web server exposing the current directory on port 8888:
      $ ./app file_server -verbose
      
    • api_server: this subcommand will run a http api server. Mysql db must be installed and configured correctly before it can run properly. See ./deployments/migration for more details.

Have fun!

FAQs

Package last updated on 15 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc