7days-golang README

The project's README from github.com/geektutu/7days-golang. As one markdown file: README.md.

7 days golang programs from scratch

CodeSize LICENSE

README 中文版本

7天用Go从零实现系列

7天能写什么呢?类似 gin 的 web 框架?类似 groupcache 的分布式缓存?或者一个简单的 Python 解释器?希望这个仓库能给你答案。

推荐先阅读 Go 语言简明教程,一篇文章了解Go的基本语法、并发编程,依赖管理等内容。

推荐 Go 语言笔试面试题,加深对 Go 语言的理解。

推荐 Go 语言高性能编程(项目地址),写出高性能的 Go 代码。

期待关注我的「知乎专栏」和「微博」,查看最近的文章和动态。

7天用Go从零实现Web框架 - Gee

Gee 是一个模仿 gin 实现的 Web 框架,Go Gin简明教程可以快速入门。

7天用Go从零实现分布式缓存 GeeCache

GeeCache 是一个模仿 groupcache 实现的分布式缓存系统

7天用Go从零实现ORM框架 GeeORM

GeeORM 是一个模仿 gorm 和 xorm 的 ORM 框架

gorm 准备推出完全重写的 v2 版本(目前还在开发中),相对 gorm-v1 来说,xorm 的设计更容易理解,所以 geeorm 接口设计上主要参考了 xorm,一些细节实现上参考了 gorm。

7天用Go从零实现RPC框架 GeeRPC

GeeRPC 是一个基于 net/rpc 开发的 RPC 框架 GeeRPC 是基于 Go 语言标准库 net/rpc 实现的,添加了协议交换、服务注册与发现、负载均衡等功能,代码约 1k。

WebAssembly 使用示例

具体的实践过程记录在 Go WebAssembly 简明教程。

  • 示例一:Hello World | Code
  • 示例二:注册函数 | Code
  • 示例三:操作 DOM | Code
  • 示例四:回调函数 | Code

What can be accomplished in 7 days? A gin-like web framework? A distributed cache like groupcache? Or a simple Python interpreter? Hope this repo can give you the answer.

Web Framework - Gee

Gee is a gin-like framework

Distributed Cache - GeeCache

GeeCache is a groupcache-like distributed cache

Object Relational Mapping - GeeORM

GeeORM is a gorm-like and xorm-like object relational mapping library

Xorm's desgin is easier to understand than gorm-v1, so the main designs references xorm and some detailed implementions references gorm-v1.

RPC Framework - GeeRPC

GeeRPC is a net/rpc-like RPC framework

Based on golang standard library net/rpc, GeeRPC implements more features. eg, protocol exchange, service registration and discovery, load balance, etc.

Golang WebAssembly Demo

7days-golang (geektutu/7days-golang)

Searching Database…

What is this?A learning repository that walks you through rebuilding four Go projects from scratch in seven days each: a gin-like web framework (Gee), a groupcache-like distributed cache (GeeCache), a gorm/xorm-like ORM (GeeORM), and a net/rpc-like RPC framework (GeeRPC), plus some Go WebAssembly demos.
Is this a ready-to-use framework or a tutorial series?It is a tutorial series with source code, not a production framework to import. Each of the four tracks is split into seven daily lessons, each with a short writeup and the corresponding code snapshot.
How do I follow along?Pick one of the four tracks (Gee, GeeCache, GeeORM, or GeeRPC), start at Day 1, and work through the linked code for each day in order; there's also a standalone WebAssembly demo folder.
Do I need Go installed to work through this?Yes, you need a working Go toolchain since every lesson is plain Go source code; no external services or API keys are required.
Are Gee, GeeCache, GeeORM, and GeeRPC meant for production use?No, they're deliberately simplified clones built for learning the internals of gin, groupcache, gorm/xorm, and net/rpc, not hardened production libraries.
What does GeeCache's Day 6 lesson teach?It covers preventing cache breakdown using the singleflight technique, so concurrent requests for the same missing key only trigger one fetch.
How does GeeRPC differ from Go's standard net/rpc?It is built on top of net/rpc but adds protocol exchange, service registration and discovery, and load balancing in roughly 1,000 lines of code.
Why does GeeORM reference xorm more than gorm?The author found xorm's design easier to understand than gorm v1, so GeeORM's interface mainly follows xorm while borrowing some implementation details from gorm.
Is there anything here beyond the four 7-day series?Yes, there are four small Go WebAssembly demos covering Hello World, registering functions, DOM manipulation, and callbacks.
Creator
geektutu
Size
1.1 MB
Stars
17K
Updated
CommitSep 05
Age
7y
Commits · 90 Days