0%

Hi all, for this article, I will keep note of how to use router group in Gin.

What is Router Group

Router Group is a function to extract routers for each group.
For example, if there are 2 features of the API, we can use Router Group to separate routers to another file and split the routers by features.

閱讀全文 »

Why

I think it’s a good idea to start with a Gin a web framework for Golang to understand advanced usage of Golang. So I decided to learn Gin day by day. (it’s a unstable plan XD)

What is Gin

Let’s see how Copilot explain Gin.

閱讀全文 »

由於小弟近期工作遇到ㄧ些架構層面上的問題,其中我和 team 上的 member Bear 再定義 Dao 及 Repository 的路上有些許的討論。

我覺得蠻有意義的,故紀錄於此。

閱讀全文 »

現今許多開發團隊表面上採用分層架構,但實際上更接近六角架構,這是因為許多專案或多或少都會使用依賴注入的緣故。
採用依賴注入後,架構的開發自然而然地更傾向於這種 Port 對 Adapter 的設計風格。

img.png

閱讀全文 »

把領域模型與業務邏輯分開,然後拿掉對基礎設施、使用者介面、甚至那些應用程式中非業務邏輯的直接依賴。把一個複雜的城市切割為不同層,在每個層中僅根據該階層本身的特性以及該層以下的各層,去考慮該層應該採用的設計模型。
By Eric Evans

在軟體架構中主要會有幾層 layer 再做不同的事情:

  1. 應用程式層 \rightarrow API 請求接收端
  2. 領域層 \rightarrow 處理業務邏輯的地方
  3. 基礎設施層 \rightarrow 呼叫外部 API或是連線 DB的地方
閱讀全文 »