How xinliangnote/go works
This repository is a set of Go learning examples rather than one integrated application. Its main user journey is studying language basics, then exploring Gin HTTP services and a gRPC client/server example. The Gin chapters progress through routing, logging, binding and validation, and custom error handling. The graph groups related chapter implementations; several handler and middleware details are represented by their source directories because their files were not excerpted.
Main entry points: router/router.go Validation routes · router/router.go Error-handling routes · go_server/main.go gRPC server · ginDemo/main.go Logging app
Components 23
Go basics
- Syntax demos
00-基础语法/codes
Gin examples
- Routing app
01-Gin框架/codes/02-路由配置/ginDemo/main.go - Versioned routes
01-Gin框架/codes/02-路由配置/ginDemo/router/router.go - Route handlers
01-Gin框架/codes/02-路由配置/ginDemo/controller - Logging app
01-Gin框架/codes/03-日志记录/ginDemo/main.go - Logging routes
01-Gin框架/codes/03-日志记录/ginDemo/router/router.go - Route handlers
01-Gin框架/codes/03-日志记录/ginDemo/router - File logger
01-Gin框架/codes/03-日志记录/ginDemo/middleware/logger.go - Validation app
01-Gin框架/codes/04-数据绑定和验证/ginDemo/main.go - Validation routes
01-Gin框架/codes/04-数据绑定和验证/ginDemo/router/router.go - Bound handlers
01-Gin框架/codes/04-数据绑定和验证/ginDemo/router - Request signing
01-Gin框架/codes/04-数据绑定和验证/ginDemo/middleware/sign/sign.go - Member validator
01-Gin框架/codes/04-数据绑定和验证/ginDemo/validator/member/member.go - Error-handling app
01-Gin框架/codes/05-自定义错误处理/ginDemo/main.go - Error-handling routes
01-Gin框架/codes/05-自定义错误处理/ginDemo/router/router.go - Route handlers
01-Gin框架/codes/05-自定义错误处理/ginDemo/router - Error middleware
01-Gin框架/codes/05-自定义错误处理/ginDemo/middleware
gRPC example
- gRPC client
02-Go gRPC/codes/01-gRPC Hello World/go_client/main.go - gRPC server
02-Go gRPC/codes/01-gRPC Hello World/go_server/main.go - Hello controller
02-Go gRPC/codes/01-gRPC Hello World/go_server/controller/hello_controller/hello_server.go - Hello service schema
02-Go gRPC/codes/01-gRPC Hello World/go_server/proto/hello/hello.proto
Other components
- Learner
- gRPC network
Connections 19
- Learner → Syntax demos: studies
- Learner → Routing app: explores routing
- Learner → gRPC client: explores RPC
- Routing app → Versioned routes: initializes routes
01-Gin框架/codes/02-路由配置/ginDemo/main.go - Versioned routes → Route handlers: registers handlers
01-Gin框架/codes/02-路由配置/ginDemo/router/router.go - Logging app → Logging routes: initializes routes
01-Gin框架/codes/03-日志记录/ginDemo/main.go - Logging app → File logger: installs logger
01-Gin框架/codes/03-日志记录/ginDemo/main.go - Logging routes → Route handlers: registers handlers
01-Gin框架/codes/03-日志记录/ginDemo/router/router.go - Validation app → Validation routes: initializes routes
01-Gin框架/codes/04-数据绑定和验证/ginDemo/main.go - Validation routes → Bound handlers: registers handlers
01-Gin框架/codes/04-数据绑定和验证/ginDemo/router/router.go - Validation routes → Request signing: installs signing
01-Gin框架/codes/04-数据绑定和验证/ginDemo/router/router.go - Validation routes → Member validator: registers validation
01-Gin框架/codes/04-数据绑定和验证/ginDemo/router/router.go - Error-handling app → Error-handling routes: initializes routes
01-Gin框架/codes/05-自定义错误处理/ginDemo/main.go - Error-handling routes → Route handlers: registers handlers
01-Gin框架/codes/05-自定义错误处理/ginDemo/router/router.go - Error-handling routes → Error middleware: installs middleware
01-Gin框架/codes/05-自定义错误处理/ginDemo/router/router.go - gRPC client → gRPC network: calls service
02-Go gRPC/codes/01-gRPC Hello World/go_client/main.go - gRPC network → gRPC server: serves requests
- gRPC server → Hello controller: registers service
02-Go gRPC/codes/01-gRPC Hello World/go_server/main.go - gRPC server → Hello service schema: registers schema service
02-Go gRPC/codes/01-gRPC Hello World/go_server/main.go