Skip to content

Gohex is a CLI application that helps you create the initial files and folders to implement the hexagonal architecture in a microservice with Go.

License

Notifications You must be signed in to change notification settings

AndresXLP/gohex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gohex

Gohex is a CLI application that helps you create the initial files and folders to implement the hexagonal architecture in a microservice with Go.


Intall

It can be installed by running:

$ go install github.com/andresxlp/gohex@latest


Usage

  1. Create a folder where you are going to work and enter it:
    • $ mkdir myProyect && cd $_
  2. Execute gohex command:
    • $ gohex new myProyect
  3. Set necessary env's to run SERVER_HOST SERVER_PORT
    • If you develop in IntelliJ or Goland IDE set env in your build configuration
    • If you develop in VSCode create an .env file in your root folder and check the config.go file

Structure

This generator has basic structure like this

Folder Struct:
  ROOT FOLDER
  ├─ cmd
  │  └─ providers
  ├─ config
  └─ internal
     ├─ app
     ├─ constants
     ├─ domain
     │  ├─ dto
     │  ├─ entity
     │  └─ ports
     └─ infra
        ├─ api
        │  ├─ handler
        │  ├─ middleware
        │  └─ router
        │     └─ groups
        └─ resource

Dependency

As main dependencies for the creation of the initial structure we use:

  • echo - High performance, extensible, minimalist Go web framework.
  • dig - A reflection based dependency injection toolkit for Go.
  • envconfig - Decoding of environment variables.

Environments

When Gohex successfully creates the initial structure, don't forget set the environment variables to run your Microservice locally

  • SERVER_HOST: host for the server
  • SERVER_PORT: port for the server

Creator


Contributors

About

Gohex is a CLI application that helps you create the initial files and folders to implement the hexagonal architecture in a microservice with Go.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages