

Github GitHub - go-kratos/kratos: A Go framework for microservices.
source link: https://github.com/go-kratos/kratos
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Kratos
Kratos is a microservice-oriented governance framework implements by golang, which offers convenient capabilities to help you quickly build a bulletproof application from scratch.
The name is inspired by the game God of War which is based on Greek myths, tells the Kratos from mortals to become a God of War and launches the adventure of killing god.
Goals
Kratos boosts your productivity. With the integration of excellent resources and further support, programmers can get rid of most issues might encounter in the field of distributed systems and software engineering such that they are allowed to focus on the release of businesses only. Additionally, for each programmer, Kratos is also an ideal one learning warehouse for many aspects of microservices to enrich their experiences and skills.
Principles
- Simple: Appropriate design, plain and easy code.
- General: Cover the various utilities for business development.
- Highly efficient: Speeding up the efficiency of businesses upgrading.
- Stable: The base libs validated in the production environment which have the characters of the high testability, high coverage as well as high security and reliability.
- Robust: Eliminating misusing through high quality of the base libs.
- High-performance: Optimal performance excluding the optimization of hacking in case of unsafe.
- Expandability: Properly designed interfaces, you can expand utilities such as base libs to meet your further requirements.
- Fault-tolerance: Designed against failure, enhance the understanding and exercising of SRE within Kratos to achieve more robustness.
- Toolchain: Includes an extensive toolchain, such as the code generation of cache, the lint tool, and so forth.
Features
- APIs: The communication protocol is based on the HTTP/gRPC through the definition of Protobuf.
- Errors: Both the definitions of error code and the handle interfaces of code generation for tools are defined by the Enum of the Protobuf.
- Metadata: In the protocol of HTTP/gRPC, the transmission of service atomic information are formalized by the Middleware.
- Config: Multiple data sources are supported for configurations and integrations such that dynamic configurations are offered through the manner of Atomic operations.
- Logger: The standard log interfaces ease the integration of the third-party log libs and logs are collected through the Fluentd.
- Metrics: Prometheus integrated by default. Furthermore, with the uniform metric interfaces, you can implement your own metric system more flexible.
- Tracing: The OpenTelemetry is conformed to achieve the tracing of microservices chains.
- Encoding: The selection of the content encoding is automatically supported by Accept and Content-Type.
- Transport: The uniform plugins for Middleware are supported by HTTP/gRPC.
- Registry: The interfaces of the centralized registry is able to be connected with various other centralized registries through plug-ins.
Getting Started
Required
Installing
go get github.com/go-kratos/kratos/cmd/kratos/v2@latest
Create a service
# create project template
kratos new helloworld
cd helloworld
# download modules
go mod download
# generate Proto template
kratos proto add api/helloworld/helloworld.proto
# generate Proto source code
kratos proto client api/helloworld/helloworld.proto
# generate server template
kratos proto server api/helloworld/helloworld.proto -t internal/service
# generate all proto source code, wire, etc.
go generate ./...
# compile
go build -o ./bin/ ./...
# run
./bin/helloworld -conf ./configs
Kratos Boot
import "github.com/go-kratos/kratos/v2"
import "github.com/go-kratos/kratos/v2/transport/grpc"
import "github.com/go-kratos/kratos/v2/transport/http"
httpSrv := http.NewServer(http.Address(":8000"))
grpcSrv := grpc.NewServer(grpc.Address(":9000"))
app := kratos.New(
kratos.Name("kratos"),
kratos.Version("latest"),
kratos.Server(httpSrv, grpcSrv),
)
app.Run()
Related
Community
License
Kratos is MIT licensed. See the LICENSE file for details.
Contributors
Thanks for their outstanding contributions.
Recommend
-
179
README.md Kratos Kratos是bilibili开源的一套Go微服务框架,包含大量微服务相关框架及工具。主要包括以下组件:
-
190
Kratos Kratos是 bilibili 开源的一套Go微服务框架,包含大量微服务相关框架及工具。主要包括以下组件:
-
16
README.md
-
58
Kratos是bilibili开源的一套Go微服务框架,包含大量微服务相关框架及工具。 名字来源于:《战神》游戏以希腊神话为背景,讲述由凡人成为战神的奎托斯(Kratos)成为战神并展开弑神屠杀的冒险历程。 好!开始吧! ...
-
20
B站微服务框架Kratos详细教程(7)- 数据库 ...
-
12
github.com/go-kratos/kratos(以下简称Kratos)是一套轻量级Go微服务框架,致力于提供完整的微服务研发体验,整合相关框架及周边工具后,微服务治理相关部分可对整体业务开发周期无感,从而更加聚焦于业务交付。Kratos在设计之初就考虑到了高可扩展性,组件...
-
13
Kratos技术系列|从Kratos设计看Go微服务工程实践 - 腾讯云中间件的个人空间 - OSCHINA - 中文开源技术交流社区
-
18
Gateway HTTP -> Proxy -> Router -> Middleware -> Client -> Selector -> Node Protocol HTTP -> HTTP HTTP -> gRPC gRPC -> gRPC Encoding Protobu...
-
6
kratos 微服务框架商城实战初识 kratos看文章之前推荐看一下
-
11
先来感受下用 kratos 快速创建项目 一、环境准备# 1.1 安装依赖软件 建议开启 GO111MODULE 1.2 安装 kratos cli
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK