GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - iamgoangle/gogolf-template: GO Boilerplate

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitlab
.gitlab
 
 
.idea
.idea
 
 
.vscode
.vscode
 
 
build
build
 
 
cmd
cmd
 
 
docs
docs
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.golangci.yaml
.golangci.yaml
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
UNIT_TEST_GUIDE.md
UNIT_TEST_GUIDE.md
 
 
commitlint.config.js
commitlint.config.js
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

Repository files navigation

GOGOLF Boilerplate Template

My go backend template. This is a go boiplerplate to quickly started the new project with golang and standard dependencies for local development pipeline. Tux, the Linux mascot

Table of Contents

  • Getting Started
  • Prerequsition
  • 👩‍⚕️ Pre-Commit
  • Commit Lint
  • Miscellaneous
  • Set $GOPATH
  • Hexagonal Architecture
  • Architecture Components
  • Core
  • Domain
  • Service
  • Repository
  • Dependency Injection
    • Port and Adaptor Design Patterns

Design Structure สรุปเรื่อง GopherCon 2018: Kat Zien — How Do You Structure Your Go Apps

Features

  1. Hot-Reloader with Air.
  2. Pre-commit.

Getting Started

Prerequsition

Please run $ make init to initialize the basic needed command and dependencies for your local development. We built this command to install the stuff to make the industry stnadard good grade to local development.

Here is a standard development pipeline installed.

  1. go
  2. node
  3. pre-commit

👩‍⚕️ Pre-Commit

You can reached pre-commit hooks and rules under .pre-commit-config.yaml configuration file.

Commit Lint

The commit lint is make more sense of good engineering should be. Essepcially, the commitlint, in this template I've follow the convention here https://www.conventionalcommits.org/en/v1.0.0/

Miscellaneous

Set $GOPATH

The $GOPATH environment variable lists places for Go to look for Go Workspaces.

https://go.dev/doc/gopath_code#GOPATH

Add this to your profile. If you use zsh please also update .zshrc

export GOPATH="$HOME/go"
PATH="$GOPATH/bin:$PATH"

then source .zshrc for reload the the environment. You can check you GOPATH by go env GOPATH

Hexagonal Architecture

This golang project adopt the hexagonal architecture to grouping the code by domain and context of business problems.

Architecture Components

Core

Everything surrounded the core this layer contains the concrete core business logics.

The core could be viewed as a “box” (represented as a hexagon) capable of resolve all the business logic independently.

Domain

The domain entity it contains the go struct definition of each entity that is part of the domain problem and can be used across the application.

Seperate of concern For example, this layer should not be known how the data keeps its, or how the caching store in the redis.

Port is the interfaces are the ports that external actors will plug their adapters into to drive the application.

Adapter is the implementation of the ports

Service

Service is through which the client will interact with actual business logic/domain objects. The client can be rest handlers, test agents, etc.

Repository

The repository interface allows us to connect to multiple data sources.

Dependency Injection

Port and Adaptor Design Patterns

Outside concerns, such as repositories and user interfaces, use the adapters to plug into the business domain services.

References

  • https://www.linkedin.com/pulse/part-2-go-project-layout-hexagonal-architecture-kaushal-prajapati/
  • https://www.linkedin.com/pulse/hexagonal-software-architecture-implementation-using-golang-ramaboli/
  • https://medium.com/@matiasvarela/hexagonal-architecture-in-go-cfd4e436faa3

About

GO Boilerplate

Topics

airdockergogolangreloader

Resources

Readme
Activity

Stars

28 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.