forked from go-kratos/kratos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
1,668 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,38 @@ | ||
# Kratos | ||
|
||
Kratos是[bilibili](https://www.bilibili.com)开源的一套Go微服务框架,包含大量微服务相关框架及工具。 | ||
如:discovery(服务注册发现)、blademaster(HTTP框架)、warden(gRPC封装)、log、breaker、dapper(trace)、cache&db sdk、kratos tool(代码生成等工具)等等。 | ||
Kratos是[bilibili](https://www.bilibili.com)开源的一套Go微服务框架,包含大量微服务相关框架及工具。主要包括以下组件: | ||
|
||
我们致力于提供完整的微服务研发体验,大仓整合相关框架及工具后,微服务治理相关部分可对整体业务开发周期无感,从而更加聚焦于业务交付。对每位开发者而言,整套Kratos框架也是不错的学习仓库,可以了解和参考到[bilibili](https://www.bilibili.com)在微服务方面的技术积累和经验。 | ||
* [http框架blademaster(bm)](doc/wiki-cn/blademaster.md):基于[gin](https://github.com/gin-gonic/gin)二次开发,具有快速、灵活的特点,可以方便的开发中间件处理通用或特殊逻辑,基础库默认实现了log&trace等。 | ||
* [gRPC框架warden](doc/wiki-cn/warden.md):基于官方gRPC封装,默认使用[discovery](https://github.com/bilibili/discovery)进行服务注册发现,及wrr和p2c(默认)负载均衡。 | ||
* [dapper trace](doc/wiki-cn/dapper.md):基于opentracing,全链路集成了trace,我们还提供dapper实现,请参看:[dapper敬请期待]()。 | ||
* [log](doc/wiki-cn/logger.md):基于[zap](https://github.com/uber-go/zap)的field方式实现的高性能log库,集成了我们提供的[log-agent敬请期待]()日志收集方案。 | ||
* [database](doc/wiki-cn/database.md):集成MySQL&HBase&TiDB的SDK,其中TiDB使用服务发现方案。 | ||
* [cache](doc/wiki-cn/cache.md):集成memcache&redis的SDK,注意无redis-cluster实现,推荐使用代理模式[overlord](https://github.com/bilibili/overlord)。 | ||
* [kratos tool](doc/wiki-cn/kratos-tool.md):kratos相关工具量,包括项目快速生成、pb文件代码生成、swagger文档生成等。 | ||
|
||
我们致力于提供完整的微服务研发体验,整合相关框架及工具后,微服务治理相关部分可对整体业务开发周期无感,从而更加聚焦于业务交付。对每位开发者而言,整套Kratos框架也是不错的学习仓库,可以了解和参考到[bilibili](https://www.bilibili.com)在微服务方面的技术积累和经验。 | ||
|
||
# 快速开始 | ||
|
||
```shell | ||
go get -u github.com/bilibili/kratos/tool/kratos | ||
kratos init | ||
``` | ||
|
||
`kratos init`会快速生成基于kratos库的脚手架代码,如生成[kratos-demo](https://github.com/bilibili/kratos-demo) | ||
|
||
```shell | ||
cd kratos-demo/cmd | ||
go build | ||
./cmd -conf ../configs | ||
``` | ||
|
||
打开浏览器访问:[http://localhost:8000/kratos-demo/start](http://localhost:8000/kratos-demo/start),你会看到输出了`Golang 大法好 !!!` | ||
|
||
# Document | ||
|
||
[简体中文](doc/wiki-cn/summary.md) | ||
|
||
------------- | ||
|
||
*Please report bugs, concerns, suggestions by issues, or join QQ-group 716486124 to discuss problems around source code.* | ||
|
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Summary | ||
|
||
* [介绍](README.md) | ||
* [快速开始](quickstart.md) | ||
* [案例](https://github.com/bilibili/kratos-demo) | ||
* [http blademaster](blademaster.md) | ||
* [middleware](blademaster-mid.md) | ||
* [protobuf生成](blademaster-pb.md) | ||
* [grpc warden](warden.md) | ||
* [middleware](warden-mid.md) | ||
* [protobuf生成](warden-pb.md) | ||
* [dapper trace](dapper.md) | ||
* [log](logger.md) | ||
* [log-agent](log-agent.md) | ||
* [database](database.md) | ||
* [mysql](database-mysql.md) | ||
* [hbase](database-hbase.md) | ||
* [tidb](database-tidb.md) | ||
* [cache](cache.md) | ||
* [memcache](cache-mc.md) | ||
* [redis](cache-redis.md) | ||
* [kratos tool](kratos-tool.md) |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#### net/http/blademaster | ||
|
||
##### 项目简介 | ||
|
||
http 框架,带来如飞一般的体验。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#### breaker | ||
|
||
##### 项目简介 | ||
1. 提供熔断器功能,供各种client(如rpc、http、msyql)等进行熔断 | ||
2. 提供Go方法供业务在breaker熔断前后进行回调处理 | ||
|
||
##### 配置说明 | ||
> 1. NewGroup(name string,c *Config)当c==nil时则采用默认配置 | ||
> 2. 可通过breaker.Init(c *Config)替换默认配置 | ||
> 3. 可通过group.Reload(c *Config)进行配置更新 | ||
> 4. 默认配置如下所示: | ||
_conf = &Config{ | ||
Window: xtime.Duration(3 * time.Second), | ||
Sleep: xtime.Duration(100 * time.Millisecond), | ||
Bucket: 10, | ||
Ratio: 0.5, | ||
Request: 100, | ||
} | ||
|
||
##### 测试 | ||
1. 执行当前目录下所有测试文件,测试所有功能 |
Oops, something went wrong.