You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nikkiing
4244fbe25f
|
2 years ago | |
---|---|---|
.idea | 2 years ago | |
encrypt/v1 | 2 years ago | |
enum | 2 years ago | |
glog/v1 | 2 years ago | |
meta/v1 | 2 years ago | |
pagination/v1 | 2 years ago | |
transport/v1/http | 2 years ago | |
.gitignore | 2 years ago | |
README.md | 2 years ago | |
go.mod | 2 years ago | |
go.sum | 2 years ago |
README.md
utils通用包
安装
- 设置私有仓库
go env -w GOPRIVATE=gitea.drugeyes.vip
- 设置git
git config --global url."ssh://gitea@gitea.drugeyes.vip".insteadOf "https://gitea.drugeyes.vip"
- 拉取对应版本
go get gitea.drugeyes.vip/pharnexbase/tools@v1.0.0
通用包
pagination
-
v1
说明
transport:通用http ResponseEncoder
-
v1
通用http ResponseEncoder
meta:跨服务meta信息设置和获取
-
v1
跨服务meta信息设置和获取
- user(基础用户信息)
encrypt:对称加密
-
v1
对称加密,目前包含:SHA1PRNG
glog:全局日志
- v1
- 本地环境不变,dev,pre,pro 上传阿里
// main.go 加入
func initLog() (log.Logger, func()) {
l, f := glog.NewLogger(&glog.LoggerConfig{
Env: "dev",
Id: id,
Name: Name,
Version: Version,
AliLogConfig: glog.AliLogConfig{
AccessKey: "",
AccessSecret: "",
Endpoint: "",
Project: "",
LogStore: "",
},
})
glog.NewHelper(l)
return l, f
}
// main函数加入
func main() {
...
logger, f := initLog()
defer f()
...
app, cleanup, err := wireApp(..., logger)
}
// 使用
glog.Glog.WithContext(ctx).Error("请输入正确手机号")