docs: optimization the README.md (#1149)

* docs: optimize the readme.md content
pull/1160/head
喵喵大人 3 years ago committed by GitHub
parent e9969bc655
commit 02e8bf6bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 159
      README.md
  2. BIN
      docs/images/kratos-large.png

@ -1,23 +1,43 @@
![kratos](docs/images/kratos.png)
<p align="center"><a href="https://go-kratos.dev/" target="_blank"><img src="https://github.com/go-kratos/kratos/blob/main/docs/images/kratos-large.png?raw=true"></a></p>
[![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/)
[![Build Status](https://github.com/go-kratos/kratos/workflows/Go/badge.svg)](https://github.com/go-kratos/kratos/actions)
[![GoDoc](https://pkg.go.dev/badge/github.com/go-kratos/kratos/v2)](https://pkg.go.dev/github.com/go-kratos/kratos/v2)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-kratos/kratos)](https://goreportcard.com/report/github.com/go-kratos/kratos)
[![Discord](https://img.shields.io/discord/766619759214854164?label=chat&logo=discord)](https://discord.gg/BWzJsUJ)
<p align="center">
<a href="https://github.com/go-kratos/kratos/actions"><img src="https://github.com/go-kratos/kratos/workflows/Go/badge.svg" alt="Build Status"></a>
<a href="https://pkg.go.dev/github.com/go-kratos/kratos/v2"><img src="https://pkg.go.dev/badge/github.com/go-kratos/kratos/v2" alt="GoDoc"></a>
<a href="https://goreportcard.com/report/github.com/go-kratos/kratos"><img src="https://goreportcard.com/badge/github.com/go-kratos/kratos" alt="Go Report Card" /a>
<a href="https://github.com/go-kratos/kratos/blob/main/LICENSE"><img src="https://img.shields.io/github/license/go-kratos/kratos" alt="License"></a>
<a href="https://discord.gg/BWzJsUJ"><img src="https://img.shields.io/discord/766619759214854164?label=chat&logo=discord" alt="Discord"></a>
</p>
###### Translate to: [简体中文](README_zh.md)
Translations: [English](README.md) | [简体中文](README_zh.md)
## About Kratos
> 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.
# 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.
Kratos is a microservice-oriented governance framework implements by golang, which offers convenient capabilities to help you quickly build a bulletproof application from scratch, such as:
- The [communication protocol](https://go-kratos.dev/docs/component/api) is based on the HTTP/gRPC through the definition of Protobuf.
- Abstract [transport](https://go-kratos.dev/en/docs/component/transport/overview) layer are support: [HTTP](https://go-kratos.dev/docs/component/transport/http) / [gRPC](https://go-kratos.dev/docs/component/transport/grpc).
- Powerful [middleware](https://go-kratos.dev/en/docs/component/middleware/overview) design, support: [Tracing (OpenTelemetry)](https://go-kratos.dev/docs/component/middleware/tracing)、[Metrics (Prometheus is default)](https://go-kratos.dev/docs/component/middleware/metrics)、[Recovery](https://go-kratos.dev/en/docs/component/middleware/recovery) and more.
- [Registry](https://go-kratos.dev/en/docs/component/registry) interface able to be connected with various other centralized registries through plug-ins.
- The [standard log interfaces](https://go-kratos.dev/en/docs/component/log) ease the integration of the third-party log libs and logs are collected through the *Fluentd*.
- The selection of the content [encoding](https://go-kratos.dev/en/docs/component/encoding) is automatically supported by Accept and Content-Type.
- Multiple data sources are supported for [configurations](https://go-kratos.dev/en/docs/component/config) and dynamic configurations (use atomic operations).
- In the protocol of HTTP/gRPC, use uniform [metadata](https://go-kratos.dev/en/docs/component/metadata) transfer method.
- You can define [errors](https://go-kratos.dev/en/docs/component/errors/) in protos and generate enums with protoc-gen-go.
>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.
Kratos is accessible, powerful, and provides tools required for large, robust applications.
## Learning Kratos
## Goals
Kratos has the most extensive and thorough [documentation](https://go-kratos.dev/docs/getting-started/start) and [example](./examples) library of all modern web application frameworks, making it a breeze to get started with the framework.
We also provide a [moderm template](https://github.com/go-kratos/kratos-layout), This template should help reduce the work required to setup up a modern project.
### 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.
@ -30,113 +50,48 @@ Kratos boosts your productivity. With the integration of excellent resources and
* **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](examples/helloworld/helloworld): The communication protocol is based on the HTTP/gRPC through the definition of Protobuf.
* [Errors](examples/errors/api): Both the definitions of error code and the handle interfaces of code generation for tools are defined by the Enum of the Protobuf.
* [Metadata](examples/metadata): In the protocol of HTTP/gRPC, the transmission of service atomic information are formalized by the Middleware.
* [Config](examples/config): Multiple data sources are supported for configurations and integrations such that dynamic configurations are offered through the manner of *Atomic* operations.
* [Logger](examples/log): The standard log interfaces ease the integration of the third-party log libs and logs are collected through the *Fluentd*.
* [Metrics](examples/metrics): *Prometheus* integrated by default. Furthermore, with the uniform metric interfaces, you can implement your own metric system more flexible.
* [Tracing](examples/traces): The OpenTelemetry is conformed to achieve the tracing of microservices chains.
* [Encoding](encoding): The selection of the content encoding is automatically supported by Accept and Content-Type.
* [Transport](transport/transport.go): The uniform plugins for [Middleware](middleware) are supported by [HTTP](examples/http/middlewares)/[gRPC](examples/middleware/main.go).
* [Registry](examples/registry): The interfaces of the centralized registry is able to be connected with various other centralized registries through plug-ins.
* [Validation](examples/validate): Verification rules defined in Protobuf can be supported by HTTP/gRPC service.
* [SwaggerAPI](https://github.com/go-kratos/swagger-api/blob/main/examples/helloworld/server/main.go): Swagger API generated Automatically and embed Swagger UI endpoint can be started by adding [Swagger plugin](https://github.com/go-kratos/swagger-api).
## Getting Started
### Required
- [go](https://golang.org/dl/)
- [protoc](https://github.com/protocolbuffers/protobuf)
- [protoc-gen-go](https://github.com/protocolbuffers/protobuf-go)
### Installing
##### install from go get:
```
go get github.com/go-kratos/kratos/cmd/kratos/v2@latest
kratos upgrade
```
##### install from source code:
Create a kratos playground through [docker](https://www.docker.com/products/docker-desktop):
```shell
docker run -it --rm -p 8000:8000 --workdir /workspace golang
```
git clone https://github.com/go-kratos/kratos
cd kratos
make install
```shell
apt-get update && apt-get -y install protobuf-compiler
export GOPROXY=https://goproxy.io,direct
go get github.com/go-kratos/kratos/cmd/kratos/v2@latest && kratos upgrade
```
### Create a service
```
# create project template
```shell
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 ./...
# run
kratos run
```
Use a browser to open and visit: `http://localhost:8000/helloworld/kratos`, The kratos program is running!
### 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()
```
If you need more, please visit the kratos [documentation](https://go-kratos.dev/docs/getting-started/start).
## Related
## Security Vulnerabilities
* [Tutorial](https://go-kratos.dev/docs/getting-started/start)
* [Examples](./examples)
* [Project Template](https://github.com/go-kratos/kratos-layout)
* [FAQ](https://go-kratos.dev/docs/getting-started/faq)
If you discover a security vulnerability within Kratos, please send an e-mail to tonybase via go-kratos@googlegroups.com. All security vulnerabilities will be promptly addressed.
## Community
* [Wechat Group](https://github.com/go-kratos/kratos/issues/682)
* [Discord Group](https://discord.gg/BWzJsUJ)
* Website: [go-kratos.dev](https://go-kratos.dev)
* QQ Group: 716486124
## Conventional commits
The structure of the commit message should look like the following
```text
<type>[optional scope]: <description>
[optional body]
- [Wechat Group](https://github.com/go-kratos/kratos/issues/682)
- [Discord Group](https://discord.gg/BWzJsUJ)
- [go-kratos.dev](https://go-kratos.dev)
- QQ Group: 716486124
[optional footer(s)]
```
## Contributors
The information should be commit in the following format:
- fix: simply describe the problem that has been fixed
- feat(log): simple describe of new features
- deps(examples): simple describe the change of the dependency
- break(http): simple describe the reasons for breaking change
Thank you for considering contributing to the Kratos framework! The contribution guide can be found in the [Kratos documention](https://go-kratos.dev/docs/community/contribution).
## License
Kratos is MIT licensed. See the [LICENSE](./LICENSE) file for details.
## Contributors
Thanks for their outstanding contributions.
<a href="https://github.com/go-kratos/kratos/graphs/contributors">
<img src="https://contrib.rocks/image?repo=go-kratos/kratos" />
</a>
## License
The Kratos framework is open-sourced software licensed under the [MIT license](./LICENSE).

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Loading…
Cancel
Save