Skip to content

Commit f2a7904

Browse files
committed
go
1 parent 096573e commit f2a7904

File tree

14 files changed

+172
-30
lines changed

14 files changed

+172
-30
lines changed

01语言/1go/7常用的包.md

Lines changed: 100 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,37 @@
77
- [heroku](https://www.heroku.com/) 持续部署
88
- [shields](https://shields.io/#/) 生成图标
99
- [katacoda](https://www.katacoda.com/) 真实模拟
10+
- [How-to-Make-a-Computer-Operating-System](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System) 如何做一个操作系统
11+
1012

1113
##
1214

1315
### 框架
1416

15-
[go-micro](https://github.com/micro/go-micro) 插件话微服务框架
16-
[echo](https://github.com/labstack/echo) 轻量web框架
17+
- [go-micro](https://github.com/micro/go-micro) 插件话微服务框架
18+
- [echo](https://github.com/labstack/echo) 轻量web框架
19+
- [tango](https://github.com/lunny/tango) web中间件
20+
- [go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) grpc中间件
21+
- [chess](https://github.com/gochenzl/chess) 棋牌游戏框架
22+
- [leaf](https://github.com/name5566/leaf) 游戏框架
23+
- [ebiten](https://github.com/hajimehoshi/ebiten) 2D游戏库
24+
- [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway)
25+
- [mqtt](https://github.com/zentures/surgemq) mqtt库
26+
- [iris](https://github.com/kataras/iris) web框架
27+
- [livego](https://github.com/gwuhaolin/livego) 直播框架
28+
- [mqant](https://github.com/liangdas/mqant) 游戏框架
29+
30+
### 网关
31+
32+
- [traefik](https://github.com/containous/traefik) 基于容器的网关
33+
- [kong](https://github.com/Kong/kong)
1734

1835
### Metric Logging Traceing
1936

2037
- [go-metrics](github.com/rcrowley/go-metrics)
2138
- [opentracing-go](https://github.com/opentracing/opentracing-go)
39+
- [prometheus](https://github.com/prometheus/prometheus)
40+
- [opencensus-go](https://github.com/census-instrumentation/opencensus-go)
2241

2342
### 模板
2443

@@ -31,33 +50,95 @@
3150
- [go-bindata](https://github.com/jteeuwen/go-bindata) 静态文件打包成二进制
3251

3352

34-
### 测试
53+
### 常用的库
3554

3655
- [testify](https://github.com/stretchr/testify) 代码测试,断言和模拟的工具包
56+
- [goconvey](https://github.com/smartystreets/goconvey) go测试
57+
- [govalidator](https://github.com/asaskevich/govalidator) 数据验证
58+
- [gomail](https://github.com/go-gomail/gomail) 发送邮件
59+
- [json](https://github.com/json-iterator/go) json编码解码
60+
- [configor](https://github.com/jinzhu/configor) 配置文件
61+
- [uuid](https://github.com/satori/go.uuid) UUID
62+
- [mgo](https://github.com/go-mgo/mgo) mongodb
63+
- [bolt](https://github.com/boltdb/bolt) K/V文件存储,支持事务,适合读多写少 B+树
64+
- [leveldb](https://github.com/golang/leveldb) [goleveldb](https://github.com/syndtr/goleveldb) K/V存储,不支持事务,适合读少写多 
65+
- [dgraph](https://github.com/dgraph-io/dgraph) 图数据库
66+
- [cayley](https://github.com/cayleygraph/cayley) 图数据库
67+
- [influxdb](https://github.com/influxdata/influxdb) 时序数据库
68+
- [gohbase](https://github.com/tsuna/gohbase) hbase客户端
69+
- [cetus](https://github.com/Lede-Inc/cetus) mysql中间件
70+
- [sqlx](https://github.com/jmoiron/sqlx) 构建sql
71+
- [sarama](https://github.com/Shopify/sarama) kafka客户端
72+
- [gorm](https://github.com/jinzhu/gorm) gorm
73+
- [redigo](https://github.com/gomodule/redigo) redis客户端
3774

38-
### JWT
39-
40-
- [jwt](https://github.com/dgrijalva/jwt-go) JWT
4175

42-
### 限流
76+
### 算法
4377

4478
- [ratelimit](go.uber.org/ratelimit) 优步限流
79+
- [gobreaker](https://github.com/sony/gobreaker) 断路器
80+
- [snowflake](https://github.com/bwmarrin/snowflake) 雪花算法
4581

4682

47-
### 生成文档
83+
### 机器学习
4884

49-
- [go-swagger](https://github.com/go-swagger/go-swagger) 生成文档,目前不支持go mod
85+
- [CloudForest](https://github.com/ryanbressler/CloudForest) 决策树
86+
- [golearn](https://github.com/sjwhitworth/golearn) 机器学习
87+
- [goml](https://github.com/cdipaolo/goml) 机器学习
88+
- [gorgonia](https://github.com/gorgonia/gorgonia) 机器学习
5089

51-
### 数据存储
90+
### 不常用的库
5291

53-
- [bolt](https://github.com/boltdb/bolt) K/V文件存储,支持事务,适合读多写少 B+树
54-
- [leveldb](https://github.com/golang/leveldb) [goleveldb](https://github.com/syndtr/goleveldb) K/V存储,不支持事务,适合读少写多 
55-
56-
### ORM
57-
58-
- [gorm](https://github.com/jinzhu/gorm)
59-
60-
### 验证码
92+
- [decimal](https://github.com/shopspring/decimal) 浮点数精度
93+
- [drwmutex](https://github.com/jonhoo/drwmutex) 分布式读写锁
94+
- [captcha](https://github.com/dchest/captcha) 验证码
95+
- [base64Captcha](https://github.com/mojocn/base64Captcha) 验证码
96+
- [jwt](https://github.com/dgrijalva/jwt-go) JWT
97+
- [gopher-lua](https://github.com/yuin/gopher-lua) go编译lua
98+
- [go-swagger](https://github.com/go-swagger/go-swagger) 生成文档,目前不支持go mod
99+
- [go-socket.io](https://github.com/googollee/go-socket.io) socket.io库
100+
- [kcp-go](https://github.com/xtaci/kcp-go) 生产级的UDP库
101+
- [watcher](https://github.com/radovskyb/watcher)
102+
- [gopsutil](https://github.com/shirou/gopsutil) go查看进程信息工具
103+
- [negroni](https://github.com/urfave/negroni) 原生web中间件
104+
- [lumberjack](https://github.com/natefinch/lumberjack) 文件滚动切分
105+
- [mergo](https://github.com/imdario/mergo) map和结构合并
106+
- [fsnotify](https://github.com/fsnotify/fsnotify) 跨平台文件变化通知
107+
- [httprouter](https://github.com/julienschmidt/httprouter) 路由
108+
- [websocket](https://github.com/gorilla/websocket) websocket库
109+
110+
111+
### 区块链
112+
113+
- [blockchain-tutorial](https://github.com/liuchengxu/blockchain-tutorial)
114+
115+
### 需要研究的项目
116+
117+
- [gorush](https://github.com/xiaomeng79/gorush) go推送
118+
- [centrifugo](https://github.com/xiaomeng79/centrifugo) 语言无关的消息推送
119+
- [mahjong](https://github.com/jxbdlut/mahjong) 游戏麻将
120+
121+
122+
### 学习资料
123+
124+
- [architect-awesome](https://github.com/xingshaocheng/architect-awesome) 后端架构师技术图谱
125+
- [Qix](https://github.com/ty4z2008/Qix)
126+
- [awesome-go-zh](https://github.com/chai2010/awesome-go-zh)
127+
- [raft](https://github.com/maemual/raft-zh_cn) raft
128+
- [DeepLearning-500-questions](https://github.com/scutan90/DeepLearning-500-questions) 深度学习
129+
- [nginx-book](https://github.com/taobao/nginx-book) nginx学习
130+
- [gonote](https://github.com/xmge/gonote)
131+
- [golang-swaggerui-example](https://github.com/ribice/golang-swaggerui-example)
132+
- [project-layout](https://github.com/golang-standards/project-layout)
133+
- [php](https://github.com/JingwenTian/awesome-php)
134+
- [night-reading-go](https://github.com/developer-learning/night-reading-go)
135+
- [Python-100-Days](https://github.com/jackfrued/Python-100-Days)
136+
- [project-based-learning](https://github.com/tuvtran/project-based-learning) **
137+
- [Halfrost-Field)](https://github.com/halfrost/Halfrost-Field)
138+
- [CS-Notes](https://github.com/CyC2018/CS-Notes)
139+
- [golang-open-source-projects](https://github.com/hackstoic/golang-open-source-projects)
140+
- [awesome-blockchain-cn](https://github.com/chaozh/awesome-blockchain-cn) 区块链资料
141+
- [shippy](https://github.com/EwanValentine/shippy) 微服务示例
142+
- [The-Golang-Standard-Library-by-Example](https://github.com/polaris1119/The-Golang-Standard-Library-by-Example) go标准库
61143

62-
- [captcha](https://github.com/dchest/captcha)
63144

02数据存取/1mysql/0目录.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,15 @@
1010

1111
5. [Innodb和myisam区别](./5Innodb和myisam区别.md)
1212

13+
6. [mysql设计规范](./6mysql设计规范.md)
14+
15+
7. [数据库垂直拆分](./7数据库垂直拆分.md)
16+
17+
8. [DB主从一致性架构优化](./8DB主从一致性架构优化.md)
18+
19+
9. [索引](./9索引.md)
20+
21+
10. [](./10锁.md)
22+
1323

1424

02数据存取/1mysql/2查询优化.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ myisam索引的叶子节点存储的是数据地址,innodb索引的叶子节点
1313

1414
如果表使用自增主键,那么每次插入新的记录,记录就会顺序添加到当前索引节点的后续位置,当一页写满,就会自动开辟一个新的页,使用非自增索引将会破坏原来的结构
1515

16+
### 常见优化
17+
18+
1. 如果明确知道只有一条结果返回,limit 1能够提高效率,明确告诉数据库,让它主动停止游标移动
19+
2. 强制类型转换会全表扫描
20+
3. 只返回需要的列,能够大大的节省数据传输量,与数据库的内存使用量
21+
4. 负向查询肯定不能命中索引
1622

03容器和集群/0目录.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
1. [docker](./1docker/0目录.md)
44

5-
2. [k8s](./2k8s/0目录.md)
5+
2. [k8s](./2k8s/0目录.md)
6+
7+
3. [服务网格](./3服务网格/0目录.md)

03容器和集群/2k8s/2命令.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#### k8s拉去私有仓库image
44

55
```shell
6-
kubectl create secret docker-registry registry-secret --docker-server=registry.cn-shenzhen.aliyuncs.com --docker-username=mengqingfang@zingsq --docker-password=mqf19890715 --docker-email=mengqingfang@zingsq -n default
6+
kubectl create secret docker-registry registry-secret --docker-server=registry.cn-shenzhen.aliyuncs.com --docker-username=mengqingfang@*** --docker-password= --docker-email=mengqingfang@zingsq -n default
77

88
--docker-server: 仓库地址
99
--docker-username: 仓库登陆账号
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## 目录
2+
3+
- [istio](https://github.com/istio/istio)
4+
- [官网](https://istio.io)

06工具/list.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
1. https://asciinema.org/ 命令行记录
1+
1. https://asciinema.org/ 命令行记录
2+
2. https://github.com/buger/goreplay 流量重放
3+
3. https://github.com/erguotou520/electron-ssr

07分布式系统/0目录.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@
2323
8. [一致性协议](./8一致性协议.md)
2424

2525
9. [服务发现](./9服务发现.md)
26+
27+
10. [微服务](./10微服务.md)

07分布式系统/10微服务.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## 微服务
2+
3+
### 解决什么问题
4+
1. 代码到处拷贝
5+
2. 消除复杂性扩散(一处BUG处处修改,专注性,屏蔽底层复杂度)
6+
3. SQL质量得不到保障,业务相互影响(拒绝其他业务直接操作数据层)
7+
4. 调用方爽(像操作一个本地函数)
8+
5. 提供有限接口,无限性能

16架构/000常见设计.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
## 常见设计
22

3-
1. [商品SKU设计](https://blog.csdn.net/wwwdc1012/article/details/71774280/)
3+
1. [商品SKU设计](https://blog.csdn.net/wwwdc1012/article/details/71774280/)
4+

16架构/1负载均衡.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
[参考](http://lobert.iteye.com/blog/2159970)
66

7+
[架构之家](https://mp.weixin.qq.com/s/4dzqbh2wfzbQzgFodP2_6Q)
8+
79
根据服务器的能力(硬件),承担相应的工作,是解决高性能,单点故障(高可用),扩展性(水平伸缩)的终极解决方案
810

911
### 作用
@@ -33,15 +35,12 @@
3335

3436
**一般将DNS作为第一级负载均衡,A记录对应着内部负载均衡的IP地址**
3537

36-
##### 特性
37-
38-
1. 可以根据用户IP来进行智能解析。DNS服务器可以在所有可用的A记录中寻找离用记最近的一台服务器。
39-
2. 动态DNS:在每次IP地址变更时,及时更新DNS服务器。当然,因为缓存,一定的延迟不可避免。
4038

4139
##### 缺点
4240

43-
1. 各级节点的DNS服务器不同程序的缓存会让你晕头转向
44-
2. 无法根据实际服务器的实时负载差异来调整调度策略
41+
1. 扩容非实时
42+
2. 非高可用,只负责解析ip,不负责探活
43+
3. 暴露太多外网ip
4544

4645
#### 反向代理负载均衡
4746

@@ -55,7 +54,10 @@
5554

5655
##### 缺陷
5756

58-
对反向代理服务器要求高,需要keeplive监控心跳
57+
对反向代理服务器要求高,需要keeplive监控心跳,单机有上限和时延增加
58+
59+
#### LVS
60+
lvs:Linux Virtual Server,使用集群技术,实现在linux操作系统层面的一个高性能、高可用、负载均衡服务器
5961

6062
#### IP负载均衡(LVS-NAT)
6163

16架构/2概念.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## 概念
2+
3+
### 高可用
4+
通过设计减少程序不可访问的时间
5+
### 高并发
6+
通过设计让程序能够在单位时间内处理更多的请求

16架构/3跨公网调用优化.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## 跨公网调用第三方服务
2+
3+
- 业务能接受旧数据:读取本地数据,异步代理定期更新数据
4+
- 有多个第三方服务提供商:多个第三方互备(短信)
5+
- 向第三方同步数据:本地写成功就算成功,异步向第三方同步数据

16架构/4秒杀系统.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## 秒杀系统:
2+
3+
### 思路
4+
5+
1. 将请求拦截在上游
6+
2. 充分利用缓存
7+
8+
#### 具体方案
9+
10+
- 客户端层: 按钮置灰,禁止用户重复提交请求;
11+
- 客户端层:JS限制用户在x秒之内只能提交一次请求
12+
- 站点层: 页面缓存,返回同一个页面,同一个用户限流
13+
- 服务层: 请求队列,超量直接返回"已售完"

0 commit comments

Comments
 (0)