{"id":38135461,"url":"https://github.com/micro-kit/microkit","last_synced_at":"2026-01-16T22:41:10.233Z","repository":{"id":57526331,"uuid":"220629981","full_name":"micro-kit/microkit","owner":"micro-kit","description":"基于grpc技术，开箱即用的微服务框架","archived":false,"fork":false,"pushed_at":"2022-11-23T14:23:22.000Z","size":39,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-18T05:09:54.734Z","etag":null,"topics":["grpc","grpc-server","micro-service","microkit"],"latest_commit_sha":null,"homepage":null,"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/micro-kit.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":null,"support":null}},"created_at":"2019-11-09T11:06:32.000Z","updated_at":"2024-04-13T07:25:29.000Z","dependencies_parsed_at":"2023-01-22T01:58:29.377Z","dependency_job_id":null,"html_url":"https://github.com/micro-kit/microkit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/micro-kit/microkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micro-kit%2Fmicrokit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micro-kit%2Fmicrokit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micro-kit%2Fmicrokit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micro-kit%2Fmicrokit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micro-kit","download_url":"https://codeload.github.com/micro-kit/microkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micro-kit%2Fmicrokit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28485617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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":["grpc","grpc-server","micro-service","microkit"],"created_at":"2026-01-16T22:41:10.060Z","updated_at":"2026-01-16T22:41:10.209Z","avatar_url":"https://github.com/micro-kit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 基于grpc技术，开箱即用的微服务框架\n\n基于grpc技术，开箱即用的微服务框架。目标做成一个符合云原生的跑在grpc上的微服务快速创建框架。\n\n## 简介\n\n\b在使用过go-kit和go-micro这两个go语言里毕竟出众的框架后，两个框架都有使用不爽的地方。\n\n### go-kit\ngo-kit目标是成为一个微服务的工具链，但本身不提供具体实现方式，它支持的通讯方式很多，但是多带来一个问题就是通用性问题，通用意味着兼容和丢失对某种通讯协议的友好度。\n比方说在用go-kit开发grpc微服务时，你需要编写3层代码，分别是transport、endpoint和service，目的是很好的，就是我们的transport层用http或者grpc或者其它任何接入方式都不影响service层代码编写，但是他却忽略了很重要一个现实情况，就是一个公司或一个团队要是有一种通讯协议时，它不会说短时间内切换为另一种协议，不希望因为要兼容可能永远都使用不到的协议而在代码编写上浪费更多时间，本人在开发中就遇到了频繁的编写类似代码，最后编写了工具代替手工编写。总结就是是一个很好的工具库，单需要在使用时做很多东西，且代码3层耗费开发周期。\n\n### go-micro\n使用go-micro是在入职一家新公司时开始的，这个框架可以说是go语言里最简单的微服务框架，使用简单可以快速编写代码，基本不存在go-kit存在的问题，但是它存在的问题是它做的太多了，编写了一个grpc的proto解析工具，相当于改变了grpc本身标准接口，改成了它自己的接口形式，最主要原因也就是便于插入中间件，我本人不希望改变原生grpc使用方式。第二个不友好的地方还是它做的太多了，在我编写go标准单元测试时失败了，因为它本身代码中使用了和go test冲突的命令行参数，导致我无法使用单元测试！总结就是做的太多版本发布也很块，它代码中可能存在bug你需要升级，这个时候你可能发现不是把依赖升级就可以完成的，需要改代码，当服务一多这个过程是很痛苦的。\n\n### microkit\n也就是本项目，为了解决以上问题让微服务开发更加清爽，造一个简单的轮子，让开发更快。\n1. 只使用grpc作为服务transport，所以不需要像go-kit实现3层代码，以原生grpc的方式开发代码\n2. 提供统一项目目录和模板项目，并提供一个cli工具用于创建项目。\n3. 实现常用grpc中间件，使使用本框架的项目可以从最开始就支持日志中间件、链路追踪、限流熔断、性能监控等中间件。\n4. 微服务应尽量少的读取本地配置，所以本项目配置从环境变量读取一个服务必须的参数，其它全从配置中心获取。\n5. 提供统一的客户端调用库的编写方式，加载中间件\n6. 命令行工具要可以生成helm项目配置，已方便项目符合与原生可以方便部署到k8s等云平台\n\n\n## 参考\n1. grpc中间件 [https://github.com/grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware)\n2. grpc普罗米修斯中间件 [github.com/grpc-ecosystem/go-grpc-prometheus](github.com/grpc-ecosystem/go-grpc-prometheus)\n3. grpc中间件示例 https://github.com/g4zhuj/grpc-wrapper\n4. 其它文章 https://segmentfault.com/a/1190000014546372  https://segmentfault.com/a/1190000012439580  https://segmentfault.com/a/1190000015347065\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicro-kit%2Fmicrokit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicro-kit%2Fmicrokit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicro-kit%2Fmicrokit/lists"}