{"id":36443344,"url":"https://github.com/sliveryou/micro-pkg","last_synced_at":"2026-01-11T22:01:21.834Z","repository":{"id":230730301,"uuid":"751754689","full_name":"sliveryou/micro-pkg","owner":"sliveryou","description":"go 微服务常用公共包","archived":false,"fork":false,"pushed_at":"2024-07-12T09:47:31.000Z","size":929,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-07-13T08:26:36.529Z","etag":null,"topics":["go","go-zero","golang","golang-library","gozero","microservice","microservices","package","pkg"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sliveryou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-02T08:58:08.000Z","updated_at":"2024-07-12T09:46:54.000Z","dependencies_parsed_at":"2024-06-19T21:19:59.199Z","dependency_job_id":"19adcda4-ecad-455d-8a3f-f5127ff22187","html_url":"https://github.com/sliveryou/micro-pkg","commit_stats":null,"previous_names":["sliveryou/micro-pkg"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sliveryou/micro-pkg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sliveryou%2Fmicro-pkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sliveryou%2Fmicro-pkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sliveryou%2Fmicro-pkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sliveryou%2Fmicro-pkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sliveryou","download_url":"https://codeload.github.com/sliveryou/micro-pkg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sliveryou%2Fmicro-pkg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28324835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","go-zero","golang","golang-library","gozero","microservice","microservices","package","pkg"],"created_at":"2026-01-11T22:01:21.042Z","updated_at":"2026-01-11T22:01:21.829Z","avatar_url":"https://github.com/sliveryou.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# micro-pkg\n\n[![Github License](https://img.shields.io/github/license/sliveryou/micro-pkg.svg?style=flat)](https://github.com/sliveryou/micro-pkg/blob/main/LICENSE)\n[![Go Doc](https://godoc.org/github.com/sliveryou/micro-pkg?status.svg)](https://pkg.go.dev/github.com/sliveryou/micro-pkg)\n[![Go Report](https://goreportcard.com/badge/github.com/sliveryou/micro-pkg)](https://goreportcard.com/report/github.com/sliveryou/micro-pkg)\n[![Github Latest Release](https://img.shields.io/github/release/sliveryou/micro-pkg.svg?style=flat)](https://github.com/sliveryou/micro-pkg/releases/latest)\n[![Github Latest Tag](https://img.shields.io/github/tag/sliveryou/micro-pkg.svg?style=flat)](https://github.com/sliveryou/micro-pkg/tags)\n[![Github Stars](https://img.shields.io/github/stars/sliveryou/micro-pkg.svg?style=flat)](https://github.com/sliveryou/micro-pkg/stargazers)\n\ngo 微服务常用公共包\n\n## 简介\n\n- **apollo** 阿波罗配置中心 go 客户端\n- **appsign** 服务端应用签名校验包，签名规则参考：[使用摘要签名认证方式调用 api](https://help.aliyun.com/zh/api-gateway/user-guide/use-digest-authentication-to-call-an-api)，客户端签名 go sdk：[aliyun-api-gateway-sign](https://github.com/sliveryou/aliyun-api-gateway-sign)\n- **auth** 身份认证包，包含阿里云银行卡四要素认证、阿里云企业银行卡账户认证和百度云人脸识别认证\n- **balancer** grpc 平衡器，包含了一致性 hash 平衡器\n- **captcha** base64 编码的图形验证码包，使用 redis 缓存验证码答案\n- **disabler** 功能禁用器，可以判断给定 api 或 rpc 能否放行\n- **enforcer** 基于 casbin 实现的接口决策规则执行器\n- **errcode** 通用业务错误码包，记录了业务状态码、业务消息和 http 状态码，并实现了 `GRPCStatus() *status.Status` 接口，可在 grpc 调用中流转\n- **excel** 常用 excel 操作包，包含获取所有行数据、流式读取行数据和流式写入行数据等操作 \n- **express** 通用快递查询客户端，支持 express100（快递100）和 expressBird（快递鸟）\n- **gstream** grpc 流式消息内容读写器，利用反射动态创建消息对象，流式读写消息内容\n- **health** 健康检查包，实现了 [grpc_health_v1](https://github.com/grpc/grpc/blob/master/doc/health-checking.md) 定义的健康检查服务端和客户端，并包含了一些常用中间件的健康检查器\n- **jwt** jwt token 生成和解析包，支持返回 `map[string]any` 类型的 payloads 或反序列化至指定 token 结构体\n- **limit** 基于 redis lua 脚本编写的时间段限流器和令牌桶限流器\n- **lock** 基于 etcd 实现的分布式锁\n- **notify** 通用通知服务包，包含短信、邮件验证码发送与短信、邮件验证码校验等功能，可以对发送间隔、验证间隔、一天内同一接收方、一天内同一 ip 和一天内总发送量进行限制与监控，支持 aliyun、submail 和 yunpian\n- **oss** 通用对象存储服务客户端，支持 aliyun、huawei、tencent、minio、local 和 mock\n- **promcollector** 通用 prometheus 指标收集器，包含 cpu、disk、diskio、mem 和 net 等指标的收集器\n- **retry** 通用操作重试包，对操作进行失败重试，可以组合不同的策略\n- **shorturl** 基于 murmur3 hash 的短地址标识符生成包\n- **sysctl** 通用系统控制包，包含系统信息如：主机信息、cpu 信息、内存信息、网络信息和硬盘信息等的获取和 linux 文件排它锁的实现\n- **watcher** 基于 etcd 的键值更新观察器，当观察到键发生创建或更新事件时，会触发回调函数，并实现了 casbin 的 `persist.Watcher` 接口\n- **xdb** 通用数据库连接包，返回 `*gorm.DB` 对象，支持 mysql、postgres、sqlite 和 sqlserver\n- **xdb/xfield** gorm gen 字段拓展包，支持构建原始 sql 字段和原始 sql 条件\n- **xgrpc** grpc 相关操作库，包含 grpc error 判断和 grpc code 到 http code 的转换等\n- **xgrpc/xinterceptor** 通用 grpc 拦截器，包含功能禁用处理、jwt token 传递解析、请求响应日志打印和恐慌捕获恢复等\n- **xhash** 通用 hash 校验和计算包，包含常用 hash 计算和基于 bcrypt hash 的密码生成与校验等\n- **xhttp** http 相关操作库，包含请求参数反序列化和响应参数序列化、http 客户端、http 通用写入器 和 ip 获取等\n- **xhttp/jsonrpc** 通用 json rpc 2.0 客户端，支持常规调用与批量调用\n- **xhttp/xmiddleware** 通用 http 中间件，包含跨域请求处理、功能禁用处理、jwt 认证处理、签名校验、请求响应日志打印和恐慌捕获恢复等\n- **xhttp/xreq** 通用 http 请求拓展包，包含指定可选参数列表构建 http 请求、http 拓展客户端 和 http 拓展响应等\n- **xkv** 通用 redis 集群键值相关操作库\n- **xonce** 操作执行器，只执行一次成功操作，失败可以再次执行\n- **xwebsocket** 通用 websocket 连接操作包，包含连接管理、消息接收和消息推送等\n\n## 文档\n\n- [开发规范](docs/dev-specification.md)\n- [Go 安全指南](docs/security-guide.md)\n- [Uber Go 语言编码规范](https://github.com/xxjwxc/uber_go_guide_cn)\n- [第三方库和工具](docs/third-parties.md)\n- [接口错误码](docs/errcode.md)\n- [通用 grpc 流式消息内容读写器](gstream/README.md)\n- [通用通知服务包](notify/README.md)\n- [通用对象存储服务客户端](oss/README.md)\n- [短地址标识符生成](shorturl/README.md)\n- [gorm/gen 字段拓展包](xdb/xfield/README.md)\n- [枚举类型方法生成工具](docs/enumer.md)\n- [常用监控指标](docs/metric.md)\n- [重放攻击](docs/replay-attacks.md)\n- [参考文献](docs/references.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsliveryou%2Fmicro-pkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsliveryou%2Fmicro-pkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsliveryou%2Fmicro-pkg/lists"}