How geektutu/7days-golang works
This repository is a collection of small Go implementations, not one application. Its principal user-facing flows are HTTP requests through Gee, cache lookups through GeeCache, ORM operations against SQL databases, and RPC calls through GeeRPC. The README also documents WebAssembly demos; the tree contains Gee-Bolt examples as well. Most implementation detail is unsampled, so links between those subsystems are limited to documented capabilities or the shown cache example.
Main entry points: geecache.go Cache group · record.go Session operations · server.go RPC server · gee.go HTTP server
Components 34
Gee Web
- HTTP server
gee-web/day7-panic-recover/gee/gee.go - Trie router
gee-web/day7-panic-recover/gee/router.go - Request context
gee-web/day7-panic-recover/gee/context.go - Middleware and recovery
gee-web/day7-panic-recover/gee/recovery.go - Template support
gee-web/day6-template/gee/gee.go
GeeCache
- Cache API
gee-cache/day7-proto-buf/main.go - Cache group
gee-cache/day7-proto-buf/geecache/geecache.go - LRU storage
gee-cache/day7-proto-buf/geecache/lru/lru.go - Peer selection
gee-cache/day7-proto-buf/geecache/consistenthash/consistenthash.go - Peer transport
gee-cache/day7-proto-buf/geecache/http.go - Protobuf protocol
gee-cache/day7-proto-buf/geecache/geecachepb/geecachepb.proto - Request coalescing
gee-cache/day7-proto-buf/geecache/singleflight/singleflight.go - Backing data getter
gee-cache/day7-proto-buf/main.go
GeeORM
- ORM entry point
gee-orm/day7-migrate/geeorm.go - Session operations
gee-orm/day7-migrate/session/record.go - Schema mapping
gee-orm/day7-migrate/schema/schema.go - SQL clauses
gee-orm/day7-migrate/clause/generator.go - Transactions
gee-orm/day7-migrate/session/transaction.go - Database migration
gee-orm/day7-migrate/geeorm.go
GeeRPC
- RPC client
gee-rpc/day7-registry/client.go - Discovery and balancing
gee-rpc/day7-registry/xclient/xclient.go - Service registry
gee-rpc/day7-registry/registry/registry.go - RPC server
gee-rpc/day7-registry/server.go - Service registration
gee-rpc/day7-registry/service.go - Message codec
gee-rpc/day7-registry/codec/codec.go - HTTP transport
gee-rpc/day7-registry/server.go
WebAssembly Demos
- Hello World demo
demo-wasm/hello-world/main.go - Register functions demo
demo-wasm/register-functions/main.go - DOM manipulation demo
demo-wasm/manipulate-dom/main.go - Callback demo
demo-wasm/callback/main.go
Gee Bolt
- Page storage
gee-bolt/day3-tree/page.go
Other components
- HTTP client
- SQL database
- RPC caller
Connections 27
- HTTP client → HTTP server: sends request
README.md - HTTP server → Trie router: routes request
- Trie router → Request context: dispatches handler
- Request context → Middleware and recovery: runs middleware
- HTTP server → Template support: renders templates
README.md - HTTP client → Cache API: requests key
gee-cache/day7-proto-buf/main.go - Cache API → Cache group: gets value
gee-cache/day7-proto-buf/main.go - Cache group → LRU storage: stores entries
README.md - Cache group → Peer selection: selects peer
README.md - Cache group → Peer transport: fetches remotely
README.md - Peer transport → Protobuf protocol: encodes messages
README.md - Cache group → Request coalescing: coalesces requests
README.md - Cache group → Backing data getter: loads misses
gee-cache/day7-proto-buf/main.go - Cache API → HTTP client: returns value
gee-cache/day7-proto-buf/main.go - RPC caller → RPC client: invokes method
README.md - RPC client → Discovery and balancing: selects endpoint
README.md - Discovery and balancing → Service registry: queries services
README.md - RPC client → RPC server: sends call
README.md - RPC server → Service registration: dispatches method
gee-rpc/day7-registry/server.go - RPC server → Message codec: reads and writes
gee-rpc/day7-registry/server.go - RPC server → HTTP transport: serves HTTP transport
gee-rpc/day7-registry/server.go - ORM entry point → Session operations: runs operations
README.md - Session operations → Schema mapping: maps records
README.md - Session operations → SQL clauses: builds SQL
README.md - Session operations → Transactions: runs transactions
README.md - ORM entry point → Database migration: migrates schema
README.md - Session operations → SQL database: executes queries
README.md