• Stars
    star
    115
  • Rank 298,696 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 4 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool that helps you to create a golang project in seconds that is layered base on a standard architecture layout and followed by Package-Oriented-Design guideline.

goslayer

One statement intro

GoSLayer is a tool that helps you to create a golang project in seconds.

Usage

  1. $ go get -u github.com/danceyoung/goslayer
  2. cd any directory where you will creating your project: $ goslayer
  3. Enter your project name (here is goapp) and then choose a web framework(gin or http handler, default is gin)
  4. cd goapp: go mod init goapp;go run ./cmd/myapp
  5. Open another terminal, run curl --location --request GET 'http://127.0.0.1:8080/goslayer/events' , response data will output.

Creation process and your project structure might look like this:

GoSLayer is a tool that helps you to create a golang project in seconds.

โ€ข layered base on a standard architecture layout
โ€ข followed by Package-Oriented-Design guideline
link: https://github.com/danceyoung/goslayer

Please enter your project name: goapp
Please choose a web framework,
(1) use gin, (2) use handler buildin: 1

Creating your go project with GIN
The go project is created successfully.
goapp
โ”œโ”€โ”€ cmd/
โ”‚   โ””โ”€โ”€ myapp/
โ”‚       โ””โ”€โ”€ router/
โ”‚           โ””โ”€โ”€ handler/
โ”‚           โ””โ”€โ”€ router.go
โ”‚       โ””โ”€โ”€ main.go
โ”œโ”€โ”€ internal/
โ”‚   โ””โ”€โ”€ myapp/
โ”‚       โ””โ”€โ”€ event/
โ”œโ”€โ”€ โ””โ”€โ”€ pkg/
โ”‚       โ””โ”€โ”€ middleware/

References

This tool is based on material taken from the following posts.

todo:

redis

logger

unit test, integration test