图片优化
基于elton
的脚手架,实现了数据校验、行为统计等功能。
缓存模块支持三类缓存:LRU+TTL的高速缓存,redis+ttl的共有缓存以及redis+lru+ttl的多级缓存
// redis缓存中简化的struct读取与保存
err := cache.GetRedisCache().SetStruct(context.Background(), "key", &map[string]string{
"name": "my name",
}, time.Minute)
data := make(map[string]string)
err = cache.GetRedisCache().GetStruct(context.Background(), "key", &data)
性能指标中包括以下的相关指标:
goMaxProcs
程序使用的最大CPU数量threadCount
程序当前线程数memSys
系统申请内存memHeapSys
系统申请heapmemHeapInuse
使用中的heapmemFrees
heap对象释放的数量routineCount
goroutine的数量cpuUsage
CPU使用率lastGC
上一次GC的时间numGC
GC的次数recentPause
最近一次GC暂停的时长pauseTotal
GC暂停的总时长connProcessing
当前处理中的连接数(http.Server)connProcessedCount
处理过的连接总数connAlive
当前活跃的连接数connCreatedCount
被创建的连接总数concurrency
请求并发数requestProcessedTotal
处理过的请求总数redis模块记录了当前并发请求以及pipeline请求量,可以设置最大并发请求量,提供简单的熔断处理。
编译schema对应代码
make install && make generate
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动
docker pull postgres:alpine
docker run -d --restart=always \
-v $PWD/tiny-site:/var/lib/postgresql/data \
-e POSTGRES_PASSWORD=A123456 \
-p 5432:5432 \
--name=tiny-db \
postgres:alpine
docker exec -it tiny-db sh
psql -c "CREATE DATABASE tiny;" -U postgres
psql -c "CREATE USER vicanso WITH PASSWORD 'A123456';" -U postgres
psql -c "GRANT ALL PRIVILEGES ON DATABASE tiny to vicanso;" -U postgres
docker pull redis:alpine
docker run -d --restart=always \
-p 6379:6379 \
--name=redis \
redis:alpine
node node_modules/esbuild/install.js