kratos

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2019 License: MIT

README

kratos

Language Build Status GoDoc Go Report Card

Kratos是bilibili开源的一套Go微服务框架,包含大量微服务相关框架及工具:

  • HTTP框架: Blademaster(bm)

    基于gin二次开发,具有快速、灵活的特点,可以方便的开发中间件处理通用或特殊逻辑,基础库默认实现了log&trace等。

  • gRPC框架: Warden(wd)

    基于官方gRPC封装,默认使用discovery进行服务注册发现,及wrr和p2c(默认)负载均衡。

  • 基础组件库

    • dapper trace:基于opentracing,全链路集成了trace,我们还提供dapper实现,请参看:dapper敬请期待

    • log:基于zap的field方式实现的高性能log库,集成了我们提供的log-agent敬请期待日志收集方案。

    • cache:集成memcache&redis的SDK,注意无redis-cluster实现,推荐使用代理模式overlord

    • database:集成MySQL&HBase&TiDB的SDK,其中TiDB使用服务发现方案。

  • 框架工具链

    • kratos tool:kratos相关工具量,包括项目快速生成、pb文件代码生成、swagger文档生成等。

我们致力于提供完整的微服务研发体验,整合相关框架及工具后,微服务治理相关部分可对整体业务开发周期无感,从而更加聚焦于业务交付。对每位开发者而言,整套Kratos框架也是不错的学习仓库,可以了解和参考到bilibili在微服务方面的技术积累和经验。

名字来源于:《战神》游戏以希腊神话为背景,讲述由凡人成为战神的奎托斯(Kratos)成为战神并展开弑神屠杀的冒险历程。

Requirments

Go version>=1.12 and GO111MODULE=on

Quick start

go get -u github.com/bilibili/kratos/tool/kratos
cd $GOPATH/src
kratos new kratos-demo

kratos new会快速生成基于kratos库的脚手架代码,如生成kratos-demo

cd kratos-demo/cmd
go build
./cmd -conf ../configs

打开浏览器访问:http://localhost:8000/kratos-demo/start,你会看到输出了Golang 大法好 !!!

快速开始 kratos工具

Documentation

简体中文

License

Kratos is under the MIT license. See the LICENSE file for details.


Please report bugs, concerns, suggestions by issues, or join QQ-group 716486124 to discuss problems around source code.

Directories

Path Synopsis
pkg
cache/memcache/test
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
cache/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
conf/dsn
Package dsn implements dsn parse with struct bind DSN 格式类似 URI, DSN 结构如下图 network:[//[username[:password]@]address[:port][,address[:port]]][/path][?query][#fragment] 与 URI 的主要区别在于 scheme 被替换为 network, host 被替换为 address 并且支持多个 address.
Package dsn implements dsn parse with struct bind DSN 格式类似 URI, DSN 结构如下图 network:[//[username[:password]@]address[:port][,address[:port]]][/path][?query][#fragment] 与 URI 的主要区别在于 scheme 被替换为 network, host 被替换为 address 并且支持多个 address.
conf/env
Package env get env & app config, all the public field must after init() finished and flag.Parse().
Package env get env & app config, all the public field must after init() finished and flag.Parse().
container/group
Package group provides a sample lazy load container.
Package group provides a sample lazy load container.
log
Package log 是kratos日志库.
Package log 是kratos日志库.
log/internal/core
Package core houses zap's shared internal buffer pool.
Package core houses zap's shared internal buffer pool.
net/http/blademaster/binding/example
Package example is a generated protocol buffer package.
Package example is a generated protocol buffer package.
net/http/blademaster/render
Package render is a generated protocol buffer package.
Package render is a generated protocol buffer package.
net/rpc/warden/internal/benchmark/bench/proto
Package grpc is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.
net/rpc/warden/internal/proto/testproto
Package testproto is a generated protocol buffer package.
Package testproto is a generated protocol buffer package.
str
sync/errgroup
Package errgroup provides synchronization, error propagation, and Context errgroup 包为一组子任务的 goroutine 提供了 goroutine 同步,错误取消功能.
Package errgroup provides synchronization, error propagation, and Context errgroup 包为一组子任务的 goroutine 提供了 goroutine 同步,错误取消功能.
tool
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL