Skip to content

Instantly share code, notes, and snippets.

View kevwan's full-sized avatar
🌟
Keep it simple!

Kevin Wan kevwan

🌟
Keep it simple!
View GitHub Profile
@kevwan
kevwan / go-zero-quickstart-cn.md
Last active November 1, 2025 03:21
Quickstart tutorial of go-zero project

go-zero 快速入门教程

简介

go-zero 是一个集成了各种工程实践的 web 和 rpc 框架。通过弹性设计保障了大并发服务端的稳定性,经受了充分的实战检验。go-zero 包含极简的 API 定义和生成工具 goctl,可以根据定义的 api 文件一键生成 Go, iOS, Android, Kotlin, Dart, TypeScript, JavaScript 代码,并可直接运行。

核心特性

  • 强大的工具支持:尽可能少的代码编写
  • 极简的接口:完全兼容 net/http
@kevwan
kevwan / cpu.go
Created February 10, 2024 17:21
Simulate cpu bounded services
func CpuBounded(times int) []int {
// Keeps it to a 32 bit int
num := 40
var r []int
for i := 0; i < times; i++ {
d := bubble(expand(reversePrime(fib(num))))
r = append(r, d[len(d)-1])
}
return r
}

I created an IDL to simplify the restful api development

1. Get started

  • install goctl

    GO111MODULE=on go get -u github.com/tal-tech/go-zero/tools/goctl
@kevwan
kevwan / dockerfile.md
Last active November 5, 2022 01:26
The simplest way to write Dockerfile!

1. choose a simple linux image

For example alpine, it's only about 5MB.

2. set timezone if necessary

RUN apk add --no-cache tzdata
ENV TZ America/New_York