6.02 AOP设计方案-Middleware
(base) yanglei@bogon 01-middleware % tree ./
./
├── context.go
├── context_test.go
├── go.mod
├── go.sum
├── handleFunc.go
├── httpServer.go
├── httpServer_test.go
├── matchNode.go
├── node.go
├── router.go
├── router_test.go
├── safeContext.go
├── serverInterface.go
└── stringValue.go
0 directories, 14 filesPART1. 定义Middleware
1.1 非集中式的设计方案
1.1.1 函数式的洋葱模式方案
1.1.2 非函数式的设计方案
1.2 集中式的设计方案
PART2. 调用Middleware
PART3. 测试



PART4. 面试要点
4.1 什么是AOP?
4.2 什么是洋葱模式?
4.3 什么是责任链模式?
4.4 如何实现?
附录
1. 方法值
2. 为什么root可以作为Middleware()的入参?
root可以作为Middleware()的入参?Last updated