Kratos is a microservice-oriented governance framework implements by golang,

Overview

kratos

Language Build Status GoDoc Go Report Card Discord

Translations: English | 简体中文

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.

Comments
  • 无法找到相应想依赖包

    无法找到相应想依赖包

    go build main.go main.go:11:2: cannot find package "kratos-demo/internal/server/grpc" in any of: /usr/local/Cellar/go/1.12.4/libexec/src/kratos-demo/internal/server/grpc (from $GOROOT) /Users/sunzhenya/Work/go/src/kratos-demo/internal/server/grpc (from $GOPATH) main.go:12:2: cannot find package "kratos-demo/internal/server/http" in any of: /usr/local/Cellar/go/1.12.4/libexec/src/kratos-demo/internal/server/http (from $GOROOT) /Users/sunzhenya/Work/go/src/kratos-demo/internal/server/http (from $GOPATH) main.go:13:2: cannot find package "kratos-demo/internal/service" in any of: /usr/local/Cellar/go/1.12.4/libexec/src/kratos-demo/internal/service (from $GOROOT) /Users/sunzhenya/Work/go/src/kratos-demo/internal/service (from $GOPATH)

    help wanted 
    opened by token01 25
  • RPC 服务发现问题,帮忙看看,谢谢

    RPC 服务发现问题,帮忙看看,谢谢

    rpc 服务已注册到 discovery, 通过http://127.0.0.1:7171/discovery/polls?appid=demo.service&env=dev&hostname=LAPTOP-7S54OGTM&latest_timestamp=0 也能查到, { "code": 0, "message": "0", "ttl": 1, "data": { "demo.service": { "instances": { "zone01": [ { "region": "region01", "zone": "zone01", "env": "dev", "appid": "demo.service", "hostname": "LAPTOP-7S54OGTM", "addrs": [ "grpc://127.0.0.1:9000" ], "version": "", "metadata": null, "status": 1, "reg_timestamp": 1581261208864765800, "up_timestamp": 1581261208864765800, "renew_timestamp": 1581263278866447800, "dirty_timestamp": 1581261208864765800, "latest_timestamp": 0 } ] }, "latest_timestamp": 1 } } }

    但是在客户端在调用rpc 服务时报错 discovery://default/demo.service?subset=50&zone=zone01 error context deadline exceeded!panic: context deadline exceeded

    请问要如何解决

    客户端点用方式 const AppID = "demo.service" // NOTE: example // NewClient new member grpc client func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (demoapi.DemoClient, error) { client := warden.NewClient(cfg, opts...) conn, err := client.Dial(context.Background(), "discovery://default/"+AppID) if err != nil { return nil, err } return demoapi.NewDemoClient(conn), nil }

    opened by kevinsir 22
  • feat(config): support Resolver for config variable placeholders

    feat(config): support Resolver for config variable placeholders

    using go template lib to replace placeholder to environment variable

    like this:

    http:
      server:
        # replace with env var "PORT" with default value 8080 
        port: ${PORT:8080}
        # replace with env var "TIMEOUT" without default value
        timeout: "${TIMEOUT}"
    

    please help for code reviewing @ymh199478

    thanks in advance :-)

    opened by kagaya85 20
  • [Question] context deadline exceeded

    [Question] context deadline exceeded

    version: github.com/go-kratos/kratos/v2 v2.0.0-rc6

    按教程配置kratos,并使用etcd注册发现服务。 registry.Discovery的GetService是可以获取得到服务的Endpoints信息。

    conn, err := grpc.DialInsecure(
    		context.Background(),
    		grpc.WithEndpoint("discovery:///servicename"),
    		grpc.WithDiscovery(r),
    	)
    	if err != nil {
    		panic(err)
    	}
    
    	cli := ccv1.NewConnectorClient(conn)
    	reply, err := cli.CreateConnect(context.Background(), &ccv1.CreateConnectRequest{
    		Username: "root",
    		Password: "root",
    	})
    	if err != nil {
    		log.Fatal(err)
    	}
    

    但是这样会报错: rpc error: code = DeadlineExceeded desc = context deadline exceeded

    这可能是什么原因造成?

    question 
    opened by zplzpl 20
  • ..\api\client.go:15:68: undefined: DemoClient

    ..\api\client.go:15:68: undefined: DemoClient

    环境: PS C:\src> go env set GO111MODULE=on set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\37773\AppData\Local\go-build set GOENV=C:\Users\37773\AppData\Roaming\go\env set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\37773\go set GOPRIVATE= set GOPROXY=https://goproxy.cn,direct set GOROOT=c:\go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=c:\go\pkg\tool\windows_amd64 set GCCGO=gccgo set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=NUL set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\37773\AppData\Local\Temp\go-build367084410=/tmp/go-build -gno-record-gcc-switches PS C:\src>

    安装: PS C:\src> kratos new kratos-demo go get -u github.com/bilibili/kratos/tool/kratos-gen-project go: finding golang.org/x/crypto latest go: finding golang.org/x/sys latest genproject: 安装成功! go: finding github.com/bilibili/kratos master go get -u github.com/bilibili/kratos/tool/kratos-protoc protoc: 安装成功! 2019/12/05 18:37:11 protoc --proto_path=C:\Users\37773\go/src --proto_path=C:\Users\37773\go/src/github.com/bilibili/kratos/third_party --proto_path=C:\src\kratos-demo\api --bm_out=:. api.proto google/protobuf/descriptor.proto: File not found. github.com/gogo/protobuf/gogoproto/gogo.proto:32:1: Import "google/protobuf/descriptor.proto" was not found or had errors. github.com/gogo/protobuf/gogoproto/gogo.proto:38:8: "google.protobuf.EnumOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto:46:8: "google.protobuf.EnumValueOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto:50:8: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto:92:8: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto:129:8: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined. google/protobuf/empty.proto: File not found. google/api/annotations.proto:20:1: Import "google/protobuf/descriptor.proto" was not found or had errors. google/api/annotations.proto:28:8: "google.protobuf.MethodOptions" is not defined. api.proto:6:1: Import "github.com/gogo/protobuf/gogoproto/gogo.proto" was not found or had errors. api.proto:7:1: Import "google/protobuf/empty.proto" was not found or had errors. api.proto:8:1: Import "google/api/annotations.proto" was not found or had errors. api.proto:19:15: ".google.protobuf.Empty" is not defined. api.proto:19:48: ".google.protobuf.Empty" is not defined. api.proto:20:42: ".google.protobuf.Empty" is not defined. exit status 1 exit status 1 go get -u github.com/bilibili/kratos/tool/kratos-gen-bts genbts: 安装成功! Close: 无声明 忽略此方法 Ping: 无声明 忽略此方法 dao.bts.go: 生成成功 go get -u github.com/bilibili/kratos/tool/kratos-gen-mc genmc: 安装成功! mc.cache.go: 生成成功 go get -u github.com/google/wire/cmd/wire go: finding golang.org/x/tools latest wire: 安装成功! wire: C:\src\kratos-demo\internal\di\wire.go:17:65: DemoServer not declared by package api wire: generate failed exit status 1 Project: kratos-demo OnlyGRPC: false OnlyHTTP: false Directory: C:\src\kratos-demo

    项目创建成功.

    运行: $ go build kratos-demo/api ..\api\client.go:15:68: undefined: DemoClient ..\api\client.go:21:9: undefined: NewDemoClient

    opened by Hhhha 19
  • kratos安装失败

    kratos安装失败

    执行GO111MODULE=on && go get -u github.com/go-kratos/kratos/tool/kratos

    出现下面错误

    go: downloading github.com/go-kratos/kratos v0.3.3 go: extracting github.com/go-kratos/kratos v0.3.3 go get: github.com/go-kratos/[email protected]: parsing go.mod: module declares its path as: github.com/bilibili/kratos but was required as: github.com/go-kratos/kratos

    below is my go env:

    GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/Users/shiquan/Library/Caches/go-build" GOENV="/Users/shiquan/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/shiquan/.gvm/pkgsets/go1.13/global" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/Users/shiquan/.gvm/gos/go1.13" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/Users/shiquan/.gvm/gos/go1.13/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_3/krxyp3x92d358gd8zxxqd8rh0000gn/T/go-build887245376=/tmp/go-build -gno-record-gcc-switches -fno-common"

    bug 
    opened by shiquan1988 16
  • [Feature] Maybe something like `EmitUnpopulated` should be added for custom http response encoder

    [Feature] Maybe something like `EmitUnpopulated` should be added for custom http response encoder

    What problem is the feature used to solve?

    In order to use custom response, I created a http.ResponseEncoder. However, becasue of the omitempty tag generated by protobuf, using the default golang json Marshaler will cause default values missing in the response.

    And in kratos, the json encoding implemented like this:

    func (codec) Marshal(v interface{}) ([]byte, error) {
    	if m, ok := v.(proto.Message); ok {
    		return MarshalOptions.Marshal(m)
    	}
    	return json.Marshal(v)
    }
    

    In this situation, without proto defining, it cannot use the EmitUnpopulated option. To take over this, I use the following codes to give back all the values:

    func responseEncoder(w stdHttp.ResponseWriter, r *stdHttp.Request, v interface{}) (err error) {
    	codec, _ := http.CodecForRequest(r, "Accept")
    	rawV, err := codec.Marshal(v)
    	if err != nil {
    		return err
    	}
    	rawMap := make(map[string]interface{})
    	err = codec.Unmarshal(rawV, &rawMap)
    	if err != nil {
    		return err
    	}
    
    	reply := newResponse()
    	reply.Code = 200
    	reply.Data = rawMap
    	reply.Message = "success"
    	data, err := codec.Marshal(reply)
    	if err != nil {
    		return err
    	}
    	w.Header().Set("Content-Type", contentType(codec.Name()))
    	w.WriteHeader(stdHttp.StatusOK)
    	_, err = w.Write(data)
    	if err != nil {
    		return err
    	}
    	return
    }
    

    It uses several addtional Marshal/Unmarshals, which is not elegant and low efficiency. Besides, in order to use the above code, a json_name field option has to be specified in the proto file.

    Requirements description of the feature

    Maybe something like EmitUnpopulated should be added for custom response encoder.

    feature 
    opened by ffy 15
  • [Feature]Support ServiceRegister  ServerOption

    [Feature]Support ServiceRegister ServerOption

    What problem is the feature used to solve?

    当前的初始化顺序是:先创建Service,然后创建Server。创建Server的模块中引入所有Service模块,并将Server作为参数调用Service的Register函数向Server注册。比如:

    func NewGRPCServer(c *conf.Server, greeter *service.GreeterService, greeter1 *service.Greeter1Service, greeter2 *service.Greeter2Service) *grpc.Server {
    	var opts = []grpc.ServerOption{
    		grpc.Middleware(
    			recovery.Recovery(),
    			tracing.Server(),
    			logging.Server(log.DefaultLogger),
    			metrics.Server(),
    			validate.Validator(),
    		),
    	}
    	srv := grpc.NewServer(opts...)
    	v1.RegisterGreeterServer(srv, greeter)
    	v1.RegisterGreeter1Server(srv, greeter1)
    	v1.RegisterGreeter2Server(srv, greeter2)
    	return srv
    }
    

    可以考虑由Server提供ServiceRegister选项,各Service提供Register注入到Server中,将Server依赖Service变为Service依赖Server。比如: server/grpc.go

    import "mydemo/internal/service"
    
    func NewGRPCServer(c *conf.Server) *grpc.Server {
    	var opts = []grpc.ServerOption{
                    grpc.ServiceRegisters(service.Registers...),
    		grpc.Middleware(
    			recovery.Recovery(),
    			tracing.Server(),
    			logging.Server(log.DefaultLogger),
    			metrics.Server(),
    			validate.Validator(),
    		),
    	}
    	srv := grpc.NewServer(opts...)
    	return srv
    }
    

    这样代码会简洁很多 而register的实现可以放到各个Service模块内。比如: service/service.go

    package "service"
    var Registers []grpc.ServiceRegister
    

    service/greeter_service.go

    package "service"
    
    func init(){
    	greeter := NewGreeterService()
    	register := grpc.RegisterFunc(func(srv *grpc.Server){
    		v1.RegisterGreeterService(srv, greeter)
    	})
    	Registers = append(Registers, register)
    }
    

    Requirements description of the feature

    References

    feature 
    opened by letian0805 15
  • [Feature] 配置文件增加对环境变量占位符的替换功能

    [Feature] 配置文件增加对环境变量占位符的替换功能

    背景和动机

    我们不希望将一些敏感的内容提交到 git 仓库中,所以这些敏感内容我们会和提交到 git 仓库的配置文件分离。

    我们将这些机密内容放在 dotenv运行时加载到环境变量 或是 直接存于环境变量 中。

    除此之外,配置可能因为程序运行环境发生改变,而需要动态的进行配置。

    所以我们希望 kratos 能够在配置文件中动态的识别环境变量占位符,并使用环境变量值替换配置的内容。

    提议的方案

    修订1:提议方案需根据 @tonybase 描述建议修正 修订2:语义占位符采用 os.Expand 解析规则完成,废弃修订1的讨论

    提案在配置文件中,通过占位符来替换环境变量中的功能:

    提案建议的占位符风格有如下几种:

    • %(VARIABLE_NAME) :传统的环境变量占位符
    • %env(VARIABLE_NAME)% : 带有环境变量处理器的占位符

    转义字符

    双倍的 %% 将会被视作转义,从而豁免 % 占位符被解析

    传统的环境变量占位符

    传统的占位符替换机制只能够替换环境变量(包含 dotenv 运行时加载)的内容,占位符采用 %() 包装变量名:

    data:
      database:
        driver: mysql
        source: %(DB_USERNAME):%(DB_PASSWORD)@tcp(127.0.0.1:3306)/test
    

    带有环境变量处理器的占位符

    环境变量处理器可以使配置程序具备更高的可扩展性,但相对会引入更高的复杂度。环境变量处理器实现可以被动态扩展。

    占位符结构中 process 可形成管道:

    %env([process:]VARIABLE_NAME)%
    %env([process-a:][process-b:]VARIABLE_NAME)%
    

    默认的处理器

    提案中提议了一些默认的处理器方案,除了默认方案外,处理器方案可自由扩展(kratos 提出一种接口规范,使开发者可以扩展处理器):

    读取环境变量

    等价于传统的环境变量占位符:

    data:
      database:
        user: %env(DB_USERNAME)%  # 等价于 %(DB_USERNAME)
    

    从文件读取内容的处理程序

    从环境变量 AUTH_FILE 的值中获取文件存储路径,并读取该文件内容作为值

    parameters:
        secrets: %env(file:AUTH_FILE)%
    

    支持 fallback 的环境变量读取

    当指定环境变量读取失败时,可以使用默认环境变量的值替代

    parameters:
        # 环境变量 PRIVATE_KEY 不存在,则使用 raw_key 值(非环境变量解析)替代
        private_key_a: %env(default:raw_key:PRIVATE_KEY)%
    
        # 环境变量 PRIVATE_KEY 不是一个有效的文件路径,使用 raw_key 值(非环境变量解析)替代
        private_key_b: %env(default:raw_key:file:PRIVATE_KEY)%
    

    补充

    • yaml 标准本身不支持变量占位符
    • 占位符格式应在不同配置格式中都具备良好的可读性
    good first issue feature 
    opened by ymh199478 15
  • fix:调整consul注册写法,将gprc和http注册为不同的srvId,并通过tag区分grpc和http服务(#1690)

    fix:调整consul注册写法,将gprc和http注册为不同的srvId,并通过tag区分grpc和http服务(#1690)

    Description (what this PR does / why we need it):

    在保证接口不变的情况下,利用tag区分grpc和http服务。通过tag过滤支持spring cloud和kratos的互相服务发现

    Which issue(s) this PR fixes (resolves / be part of):

    fixes #1690

    Other special notes for reviewer:

    spring cloud 服务注册tag配置 spring.application.name=spring-cloud-consul-producer server.port=8501 spring.cloud.consul.host=localhost spring.cloud.consul.port=8500 spring.cloud.consul.discovery.serviceName=helloworld spring.cloud.consul.discovery.tags=version=,scheme=http spring cloud 服务发现tag配置 spring.application.name=spring-cloud-consul-consumer server.port=8503 spring.cloud.consul.host=127.0.0.1 spring.cloud.consul.port=8500

    spring.cloud.consul.discovery.heartbeat.enabled=true spring.cloud.consul.discovery.health-check-path=/actuator/health spring.cloud.consul.discovery.default-query-tag=version=,scheme=http

    opened by kingdom2014 14
  • [Question] 请教下pb error的问题

    [Question] 请教下pb error的问题

    extend google.protobuf.EnumOptions {
      int32 default_code = 1108;
    }
    
    extend google.protobuf.EnumValueOptions {
      int32 code = 1109;
    }
    

    这里的1108和1109是什么意思?为什么我改了_errors.pb.go 无法生成?

    question 
    opened by mrzxy 14
  • feat: grpc use the admin api

    feat: grpc use the admin api

    Description (what this PR does / why we need it):

    support grpcdebug https://github.com/grpc-ecosystem/grpcdebug

    Which issue(s) this PR fixes (resolves / be part of):

    Other special notes for the reviewers:

    opened by shenqidebaozi 1
  • [Feature] http.NewClient允许支持带前缀path的endpoint

    [Feature] http.NewClient允许支持带前缀path的endpoint

    当前endpoint如果为http://127.0.0.1:8080/some_path时,NewClient实际会去掉后面的路径部分。 而在某些场景时,endpoint带路径是有必要的。如这个路径(/some_path)是由网关加出来的,此时他不应该包含于proto中路径的定义,最好的做法是通过这里的endpoint传入 conn, err := http.NewClient( context.Background(), http.WithEndpoint("http://127.0.0.1:8080/some_path"), )

    feature 
    opened by kimloong 0
  • [Proposal] export RegisterXxxHTTPRouter method

    [Proposal] export RegisterXxxHTTPRouter method

    Proposal description

    Related to #2593

    Implementation code

    # file: cmd/protoc-gen-go-http/template.go
    # line: 23
    
    func Register{{.ServiceType}}HTTPServer(s *http.Server, srv {{.ServiceType}}HTTPServer) {
    	r := s.Route("/")
    + 	Register{{.ServiceType}}HTTPRouter(r, srv)
    + }
    + 
    + func Register{{.ServiceType}}HTTPRouter(r *http.Router, srv {{.ServiceType}}HTTPServer) {
    	{{- range .Methods}}
    	r.{{.Method}}("{{.Path}}", _{{$svrType}}_{{.Name}}{{.Num}}_HTTP_Handler(srv))
    	{{- end}}
    }
    

    Usage demonstration

    srv := http.NewServer(opts...)
    r := srv.Route("/prefix", middlewares...)
    v1.RegisterXxxServiceHTTPRouter(r, service)
    
    proposal 
    opened by Nomango 0
  • feat: support polaris service governance

    feat: support polaris service governance

    Description (what this PR does / why we need it):

    Which issue(s) this PR fixes (resolves / be part of):

    Other special notes for the reviewers:

    opened by shenqidebaozi 0
  • build(deps): bump github.com/prometheus/common from 0.37.0 to 0.39.0 in /contrib/metrics/prometheus

    build(deps): bump github.com/prometheus/common from 0.37.0 to 0.39.0 in /contrib/metrics/prometheus

    Bumps github.com/prometheus/common from 0.37.0 to 0.39.0.

    Release notes

    Sourced from github.com/prometheus/common's releases.

    v0.39.0

    • [ENHANCEMENT] Add support for proxy connect headers. #409
    • [ENHANCEMENT] Add platform info to labels. #403

    v0.37.1

    • [BUGFIX] Update go.mod for CVE-2022-41717 #420

    v0.38.0

    • [FEATURE] Implement Stringer on TLSVersion (#405)
    • [FEATURE] Check if TLS certificate and key file have been modified (#345)
    • [ENHANCEMENT] Add the ability to specify the maximum acceptable TLS version (#414)
    • [ENHANCEMENT] Make LoadHTTPConfigFile set directory and move from tests file (#415)
    • [ENHANCEMENT] Get Revision from debug.BuildInfo if not explicitly set (#374)
    Commits
    • 296ec92 Merge pull request #409 from prometheus/mem/proxy_header
    • 18281a2 Merge pull request #424 from prometheus/repo_sync
    • 4a0d730 Add support for proxy connect headers
    • 017dec0 Update common Prometheus files
    • befeabf Merge pull request #422 from prometheus/superq/add_mod_check
    • 1bc7f65 Add platform info to labels (#403)
    • 82accf3 Add go mod version test
    • 00e3fd7 Merge pull request #418 from roidelapluie/go119
    • 045094f Update deps and test with go 1.19
    • ddb642f Merge pull request #421 from prometheus/superq/update_sigv4
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies go 
    opened by dependabot[bot] 0
Releases(v2.5.3)
  • v2.5.3(Nov 10, 2022)

    contrib -> a7bae93ee08d95c84ecd8deed8a912b7aed7129a

    Dependencies

    • deps: upgrade kratos version to v2.5.3 (#2500)

    New Features

    • feat: add app Before and Afters option (#2403)

    Bug Fixes

    • fix(selector): set global do not work (#2489)
    • fix(filter): filter out keyvals if keyFunc is provided (#2484)
    • fix(contrib/log): test case error (#2487)
    • fix ewma panic (#2480)

    Others

    • build(deps): bump github.com/apolloconfig/agollo/v4 (#2421)
    • build(deps): bump go.etcd.io/etcd/client/v3 in /contrib/registry/etcd (#2384)
    • build(deps): bump google.golang.org/grpc in /contrib/opensergo (#2452)
    • build(deps): bump google.golang.org/grpc in /contrib/config/etcd (#2453)
    • typo: correct var name (#2496)
    • build(deps): bump github.com/hashicorp/consul/api (#2472)
    • build(deps): bump github.com/prometheus/client_golang (#2494)
    • build(deps): bump github.com/polarismesh/polaris-go (#2493)
    • build(deps): bump github.com/aliyun/aliyun-log-go-sdk (#2492)
    • build(deps): bump google.golang.org/grpc in /contrib/registry/etcd (#2454)
    • test(encoding/form): add unit test and code style modift (#2467)
    • style(config): code style tweaks and abstracts some methods (#2465)
    • build(deps): bump github.com/hashicorp/consul/api (#2473)
    • build(deps): bump github.com/aliyun/aliyun-log-go-sdk (#2483)
    • style(contrib/config): code style modify (#2475)

    New Contributors

    • @migmartri made their first contribution in https://github.com/go-kratos/kratos/pull/2484
    • @JellyTony made their first contribution in https://github.com/go-kratos/kratos/pull/2403

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.5.2...v2.5.3

    Source code(tar.gz)
    Source code(zip)
  • v2.5.2(Oct 19, 2022)

    Bug Fixes

    • fix(log): toString float32 precision loss and convert uint use FormatUint (#2461)
    • fix net error (#2460)
    • fix(metadata): sort services by lexicographical order on ListServices (#2397)
    • fix: in for defer close (#2411)
    • fix: contrib/registry/eureka/client.go serveice -> serivce (#2440)

    Others

    • build(deps): bump actions/setup-go from 3.3.0 to 3.3.1 (#2462)
    • cleanup: use HTTP package methods replace GET POST DELETE... (#2412)
    • test(middleware/auth/jwt): add test TestNewContextAndFromContext (#2447)
    • test(middleware/metadata): supplement test and modify code style (#2448)
    • docs(config/etcd): fix the missing step of Load (#2450)
    • [Feature] add path prefix for http server (#2439)
    • cleanup: regex replcae . => . (#2435)
    • test(middleware/logging): TestExtractError (#2443)
    • cleanup: update scpSyntaxRe regexp (#2444)
    • style: kratos interface check (#2441)

    New Contributors

    • @ruohone made their first contribution in https://github.com/go-kratos/kratos/pull/2439

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.5.1...v2.5.2

    Source code(tar.gz)
    Source code(zip)
  • v2.5.1(Oct 10, 2022)

    New Features

    • feat: golangci add goimports local-prefixes (#2413)
    • feat: remote assert libraries (#2372)
    • feat(internal/host): prefer ipv4 than ipv6 (#2342)
    • feat(cmd): user prePage to check changelog dev (#2340)

    Bug Fixes

    • fix: fmt import (#2379)
    • fix(aliyun log): 'format bool' is missing in 'toString' function (#2406)
    • fix: modify interface check way on selector (#2399)
    • fix(http/binding): fix http encode url (#2400)
    • fix(registry/consul): use health check option to control custom checks (#2391)
    • fix(http/binding): fix http encode url (#2392)
    • fix: typo and grammatical errors (#2368)
    • fix: .gitignore del Repeated .*so (#2367)
    • fix: modify interface check way (#2375)
    • fix(apollo): config return nil when watch err
    • fix(makefile): add "make proto" for proto generating (#2130)

    Chores

    • chore(log): let log toString same (#2414)
    • chore: Update go.yml (#2426)

    Others

    • cleanup: remove redundancy type conversion and golangci add unconvert (#2409)
    • add custom binding (#2428)
    • expose request from transport (#2427)
    • style: modify declaring empty slices (#2378)
    • style(config/value): optimize atomicValue format string (#2401)
    • test(log): add toString unit test (#2373)
    • cleanup: remove fmt and errors new err (#2377)
    • cleanup: remove the repeated import (#2393)
    • cleanup: modify deprecated field (#2380)
    • typo for log (#2374)
    • test: supplement the unit testing of transport/grpc (#2371)
    • revise err logic or null pointer exception (#2376)
    • test(cmd): add ModulePath test (#2337)

    New Contributors

    • @demoManito made their first contribution in https://github.com/go-kratos/kratos/pull/2291
    • @icylight made their first contribution in https://github.com/go-kratos/kratos/pull/2296
    • @SeigeC made their first contribution in https://github.com/go-kratos/kratos/pull/2299
    • @Wang-TaoTao made their first contribution in https://github.com/go-kratos/kratos/pull/2323
    • @hrygo made their first contribution in https://github.com/go-kratos/kratos/pull/2353
    • @guowei-gong made their first contribution in https://github.com/go-kratos/kratos/pull/2349
    • @xiaoliwang made their first contribution in https://github.com/go-kratos/kratos/pull/2374
    • @swliao425 made their first contribution in https://github.com/go-kratos/kratos/pull/2406
    • @gaffeyQiu made their first contribution in https://github.com/go-kratos/kratos/pull/2401

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.5.0...v2.5.1

    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Aug 17, 2022)

    contrib -> go get github.com/kraots/contrib/xxxx@ba722304772728e1cd286e7d5a89de2ff4ae10ae

    Dependencies

    • deps: upgreade kratos version to v2.5.0 (#2286)

    New Features

    • feat: add servicecomb registry (#2114)
    • feat(registry): consul get service support remote (#2275)
    • feat(log): add tencent cls (#2244)

    Bug Fixes

    • fix: encoding form decode field mask from well-know (#2285)
    • fix typo (#2284)
    • fix: delete endpoint service discovery compatibility (#2289)
    • fix logger caller depth (#2283)
    • fix: wrong order of Logger prefix kvs (#2273)
    • fix(log): DefaultCaller doesn't returns "pkg/file:line", it returns "file:line" now. For example, both biz/user.go and data/user.go are printed as user.go in logger. It's not clear. (#2274)
    • fix(chore): set nacos-server v2.1.0 and consul v1.12.3 (#2268)
    • fix lint error (#2266)
    • fix: in case url or form bind param error should return BadRequest (#2256)
    • fix(registry): contrib/registry/zookeeper ephemeral nodes handling after restart (#2245)

    Others

    • doc: grammar problems in the Readme file (#2281)
    • bc: apollo unable to get and watch to the properties file (#2269)
    • refactor(log) aliyun use the same interface name (#2251)
    • refactor: unify selector filter (#2277)
    • Global logger (#2265)
    • build(deps): bump google.golang.org/protobuf in /contrib/log/aliyun (#2249)
    • build(deps): bump github.com/prometheus/common (#2210)

    New Contributors

    • @Germiniku made their first contribution in https://github.com/go-kratos/kratos/pull/2244
    • @hawkingrei made their first contribution in https://github.com/go-kratos/kratos/pull/2268
    • @SeniorPlayer made their first contribution in https://github.com/go-kratos/kratos/pull/2274
    • @kkf1 made their first contribution in https://github.com/go-kratos/kratos/pull/2114
    • @YidaZhou made their first contribution in https://github.com/go-kratos/kratos/pull/2281

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.4.1...v2.5.0

    Source code(tar.gz)
    Source code(zip)
  • v2.4.1(Jul 28, 2022)

    contrib -> go get github.com/kraots/contrib/xxxx@eff368621fb383112bfd8c79b4379036fc245193

    New Features

    • feat(middleware): add selector matcher (#2239)
    • feat: support passing program args with run cmd (#2207)

    Bug Fixes

    • fix default behavior for gRPC encoding (#2187)
    • fix: zookeeper add auto re-register (#2235)
    • fix(contrib/config/polaris): Use injected client properly (#2238)
    • fix: remove unuseful file when use nomod (#2234)
    • fix(contrib): add logrus fatal level (#2222)

    Others

    • update ignore for go workspace (#2240)
    • build(deps): bump k8s.io/client-go in /contrib/config/kubernetes (#2217)
    • build(deps): bump k8s.io/client-go in /contrib/registry/kubernetes (#2218)
    • build(deps): bump github.com/hashicorp/consul/api (#2211)
    • build(deps): bump github.com/hashicorp/consul/api (#2209)
    • build(deps): bump k8s.io/api in /contrib/config/kubernetes (#2219)
    • build(deps): bump k8s.io/api in /contrib/registry/kubernetes (#2220)
    • build(deps): bump github.com/go-zookeeper/zk (#2236)
    • proto build client structName not match to server's structName (#2200)
    • docs: update README_zh.md (#2208)
    • build(deps): bump github.com/prometheus/common (#2188)
    • build(deps): bump actions/setup-go from 3.2.0 to 3.2.1 (#2189)
    • Feature/improve app test (#2190)
    • test: increase endpoint,env, options and reader tests coverage. (#2192)
    • test(contrib): update unit test for contrib/registry/polaris (#2196)
    • test(log): increase tests coverage (#2197)

    New Contributors

    • @walrusyu made their first contribution in https://github.com/go-kratos/kratos/pull/2190
    • @fengyuwusong made their first contribution in https://github.com/go-kratos/kratos/pull/2208
    • @paulip1792 made their first contribution in https://github.com/go-kratos/kratos/pull/2238
    • @Nomango made their first contribution in https://github.com/go-kratos/kratos/pull/2207
    • @180909 made their first contribution in https://github.com/go-kratos/kratos/pull/2240

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.4.0...v2.4.1

    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Jul 11, 2022)

    contrib -> go get github.com/kraots/contrib/xxxx@1451b9e0c0e3e1ee88a4595d9f9cfaf24eb8150f

    New Features

    • feat(http): add http router walk (#2181)
    • feat(metadata): Ignore service if the dependencies are not found (#2171)
    • feat: add logrus to contrib log (#2077)
    • feat: add contrib/config/polaris polaris as configcenter (#2158)
    • feat: add protoc-gen-go-http annotations synchronization with protoc-gen-go-grpc (#2151)

    Bug Fixes

    • fix(transport): http endpoint listening (#2180)
    • fix transport early listening (#2177)
    • fix(errors): panic when err of Clone is nil (#2176)
    • fix(encoding/form): encode optional value (#2155)
    • fix: typo on emptypb.Empty (#2150)

    Others

    • test(options): increase tests coverage (#2183)
    • test(transport): add unit test for transport coverage: 91.7% of state… (#2172)
    • test(contrib): add unit test for contrib/metrics/prometheus (#2182)
    • test(contrib/config/consul): add unit test for contrib/config/consul (#2179)
    • test(errors): improve coverage (#2178)
    • build(deps): bump k8s.io/client-go in /contrib/registry/kubernetes (#2120)
    • tests(coverage): Increase middleware tests coverage (#2165)
    • test(config/file): add format test (#2147) (#2168)
    • build(deps): bump github.com/hashicorp/consul/api (#2082)
    • test(contrib): add unit test for contrib/registry/k8s (#2166)
    • build(deps): bump github.com/hashicorp/consul/api (#2081)
    • build(deps): bump k8s.io/client-go in /contrib/config/kubernetes (#2122)
    • build(deps): bump k8s.io/api in /contrib/registry/kubernetes (#2124)
    • test(contrib): add unit test for aliyun.go (#2164)
    • test(encoding/form): well konw types test (#2147) (#2160)
    • test: supplement the unit testing of metadata (#2161)
    • build(deps): bump github.com/aliyun/aliyun-log-go-sdk (#2152)
    • test(nacos): add nacos unit test and remove unused function (#2145)
    • test(contrib): add unit test for contrib/config/k8s (#2140)
    • test(contrib): add unit test for contrib/registry/consul (#2148)

    New Contributors

    • @czyt made their first contribution in https://github.com/go-kratos/kratos/pull/2078
    • @workman-Lu made their first contribution in https://github.com/go-kratos/kratos/pull/1916
    • @raw34 made their first contribution in https://github.com/go-kratos/kratos/pull/2094
    • @charviki made their first contribution in https://github.com/go-kratos/kratos/pull/2125
    • @deagon made their first contribution in https://github.com/go-kratos/kratos/pull/2132
    • @zoujiejun made their first contribution in https://github.com/go-kratos/kratos/pull/2137
    • @shifengbin made their first contribution in https://github.com/go-kratos/kratos/pull/2139
    • @ThereWeGo made their first contribution in https://github.com/go-kratos/kratos/pull/2143
    • @u5surf made their first contribution in https://github.com/go-kratos/kratos/pull/2141
    • @liuyi0618 made their first contribution in https://github.com/go-kratos/kratos/pull/2146
    • @freezeChen made their first contribution in https://github.com/go-kratos/kratos/pull/2148
    • @rogerogers made their first contribution in https://github.com/go-kratos/kratos/pull/2140
    • @Loner1024 made their first contribution in https://github.com/go-kratos/kratos/pull/2161
    • @shengzhou1216 made their first contribution in https://github.com/go-kratos/kratos/pull/2160
    • @Betula-L made their first contribution in https://github.com/go-kratos/kratos/pull/2077
    • @darkweak made their first contribution in https://github.com/go-kratos/kratos/pull/2165
    • @jakezhu9 made their first contribution in https://github.com/go-kratos/kratos/pull/2183
    • @xiongpan828 made their first contribution in https://github.com/go-kratos/kratos/pull/2185

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.3.1...v2.4.0###

    Source code(tar.gz)
    Source code(zip)
  • v2.3.1(Jun 2, 2022)

    contrib -> go get github.com/kraots/contrib/xxxx@95dce008525d763283c4cd4772afac9c1d4d3796

    New Features

    • feat: make secure url to grpcs://127.0.0.1/ (#2072)
    • feat: add config log (#2060)
    • feat:add context for log (#2041)

    Bug Fixes

    • fix with logger (#2062)
    • fix: config log

    Others

    • transport/http(feat): add redirector to forward request (#2074)
    • build(deps): bump gopkg.in/yaml.v3 in /contrib/config/nacos (#2067)
    • build(deps): bump gopkg.in/yaml.v3 in /contrib/config/apollo (#2068)
    • build(deps): bump k8s.io/client-go in /contrib/config/kubernetes (#2056)
    • build(deps): bump k8s.io/client-go in /contrib/registry/kubernetes (#2057)
    • build(deps): bump github.com/aliyun/aliyun-log-go-sdk (#2053)
    • build(deps): bump k8s.io/api in /contrib/config/kubernetes (#2052)
    • log: remove component logger to use global logger (#2061)
    • build(deps): bump k8s.io/api in /contrib/registry/kubernetes (#2058)
    • app: fix instance nil when not registered (#2059)
    • build(deps): bump actions/setup-go from 2 to 3.2.0 (#2048)
    • build(deps): bump golangci/golangci-lint-action from 2 to 3 (#2047)
    • build(deps): bump actions/checkout from 2 to 3 (#2046)
    • build(deps): bump github/codeql-action from 1 to 2 (#2045)
    • Update dependabot.yml
    • Create dependabot.yml

    New Contributors

    • @dependabot made their first contribution in https://github.com/go-kratos/kratos/pull/2045

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.3.0...v2.3.1

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(May 24, 2022)

    contrib v2.3.0 -> v2.0.0-20220524035307-70317d05a07a

    Dependencies

    • deps: upgrade go mod version (#2028)

    New Features

    • feat(contrib/opensergo): add opensergo reportMetadata fields (#1996)
    • feat(registry): zookeeper watch node changed (#1986)

    Bug Fixes

    • fix:fix error camel case (#2032)
    • fix:#2006 config.atomicValue Other basic types are supported (#2007)
    • fix(protoc-gen-go-errors): fix generated function comments have extra blank lines. (#2008)
    • fix:#2002 definition service lowercase generation cannot be exported (#2003)
    • fix: update ci gocyclo min-complexity 50 (#2000)
    • fix:(transport/http): fix unexpected overriding behavior when return an error (#1984)

    Others

    • opensergo: fix http path & method (#2035)
    • log: fix global logger (#2034)
    • http: handle default mux (#2033)
    • Update project.go (#2024)
    • Update server.go (#2021)
    • style:change (#2022)
    • Update path.go (#2023)
    • Update run.go (#2025)
    • stype:gen_go_errors (#2026)
    • Update server.go (#2027)
    • style:ewma (#2018)
    • Style:trace (#2017)
    • Update jwt.go (#2016)
    • Update metadata.go (#2015)
    • style:log (#2014)
    • Update encode.go (#2019)
    • Update endpoint.go (#2012)
    • Update host.go (#2013)
    • Update errors.go (#2009)
    • Update file.go (#2005)
    • Added ability to configure protojson (#1993)

    New Contributors

    • @yliu7949 made their first contribution in https://github.com/go-kratos/kratos/pull/1975
    • @vgjm made their first contribution in https://github.com/go-kratos/kratos/pull/1973
    • @i6u made their first contribution in https://github.com/go-kratos/kratos/pull/1977
    • @nikitaksv made their first contribution in https://github.com/go-kratos/kratos/pull/1979
    • @imzhongqi made their first contribution in https://github.com/go-kratos/kratos/pull/1989
    • @Comolli made their first contribution in https://github.com/go-kratos/kratos/pull/1991
    • @houseme made their first contribution in https://github.com/go-kratos/kratos/pull/1999
    • @windzhu0514 made their first contribution in https://github.com/go-kratos/kratos/pull/1993

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.2.2...v2.3.0

    Source code(tar.gz)
    Source code(zip)
  • v2.2.2(May 6, 2022)

    What's Changed

    • feat: supprt non-kratos instance in consul registry by @longXboy in https://github.com/go-kratos/kratos/pull/1892
    • fix: starter parent ctx by @tonybase in https://github.com/go-kratos/kratos/pull/1895
    • feat(contrib): add eureka registry (#1792) by @weetime in https://github.com/go-kratos/kratos/pull/1793
    • feat(log): log load config only when Debug level by @Cluas in https://github.com/go-kratos/kratos/pull/1899
    • fix(log): FilterFunc keyvals lost logger prefix by @Cluas in https://github.com/go-kratos/kratos/pull/1901
    • fix(log): Improper Input Validation in GoGo Protobuf CVE-2021-3121 by @shenqidebaozi in https://github.com/go-kratos/kratos/pull/1902
    • fix(transport): fix the problem that the request is not delivered correctly by @shenqidebaozi in https://github.com/go-kratos/kratos/pull/1906
    • feat(transport): add JSON codec for gRPC by @tonybase in https://github.com/go-kratos/kratos/pull/1908
    • fix(cmd): protoc-gen-go-http use self release by @YoogoC in https://github.com/go-kratos/kratos/pull/1909
    • fix(cmd): fix lint problem by @Casper-Mars in https://github.com/go-kratos/kratos/pull/1919
    • feat(registry): consul client add DeregisterCriticalServiceAfter option by @Casper-Mars in https://github.com/go-kratos/kratos/pull/1917
    • feat: change description of Kratos by @Casper-Mars in https://github.com/go-kratos/kratos/pull/1920
    • feat: add error cause for statck trace by @tonybase in https://github.com/go-kratos/kratos/pull/1910
    • fix(cmd): generate error func name and unit test fail by @fifsky in https://github.com/go-kratos/kratos/pull/1923
    • fix(metadata): correct the function name in metadata log text by @Windfarer in https://github.com/go-kratos/kratos/pull/1915
    • feat(selector): add node scheme by @tonybase in https://github.com/go-kratos/kratos/pull/1932
    • feat(discovery): provide an option to disable discovery debug log by @yeqown in https://github.com/go-kratos/kratos/pull/1942
    • feat: add opensergo metadata by @tonybase in https://github.com/go-kratos/kratos/pull/1947
    • fix client do method done not use when err not nil by @zhaobingchun in https://github.com/go-kratos/kratos/pull/1948
    • fix bind test errors by @Donglong in https://github.com/go-kratos/kratos/pull/1950
    • fix(contrib/opensergo): fix index error by @Casper-Mars in https://github.com/go-kratos/kratos/pull/1951
    • fix: fix choose failed when path is cmd/server by @haiyux in https://github.com/go-kratos/kratos/pull/1954
    • fix: fix kratos run when cmd number is one by @haiyux in https://github.com/go-kratos/kratos/pull/1956
    • feat:new and add karge warehouse by @haiyux in https://github.com/go-kratos/kratos/pull/1953
    • fix(transport/http): responseEncoder should not write any data when it need to write nil by @Donglong in https://github.com/go-kratos/kratos/pull/1945
    • feat(registry): contrib/registry/zookeeper add digest acl support by @youzhixiaomutou in https://github.com/go-kratos/kratos/pull/1964
    • feat: protoc-gen-go-errors add comment by @JeffreyBool in https://github.com/go-kratos/kratos/pull/1961
    • feat(log): Helper implemented io.Writer by @elricli in https://github.com/go-kratos/kratos/pull/1927
    • deps: upgrade kratos version to v2.2.2 by @shenqidebaozi in https://github.com/go-kratos/kratos/pull/1944

    New Contributors

    • @weetime made their first contribution in https://github.com/go-kratos/kratos/pull/1793
    • @YoogoC made their first contribution in https://github.com/go-kratos/kratos/pull/1909
    • @zhaobingchun made their first contribution in https://github.com/go-kratos/kratos/pull/1948
    • @Donglong made their first contribution in https://github.com/go-kratos/kratos/pull/1950
    • @youzhixiaomutou made their first contribution in https://github.com/go-kratos/kratos/pull/1964
    • @JeffreyBool made their first contribution in https://github.com/go-kratos/kratos/pull/1961

    Full Changelog: https://github.com/go-kratos/kratos/compare/v2.2.1...v2.2.2

    Source code(tar.gz)
    Source code(zip)
  • v2.2.1(Mar 18, 2022)

    contrib v2.2.1 -> v2.0.0-20220318035139-e98c0078cb29

    Dependencies

    • deps: upgrade kratos version to 2.2.1 (#1890)

    New Features

    • feat: add semantic.yml (#1876)
    • feat: add zero prealloc (#1847)
    • feat(example/transaction/ent): add ent install in Makefile (#1844)
    • feat(examples/transaction): feature transaction gorm (#1838)

    Bug Fixes

    • fix: update semantic (#1891)
    • fix(cmd): proto-gen-go-http warn only when ending with a slash (#1887)
    • fix(log): call depth (#1885)
    • fix: kratos command error on windows (#1884)
    • fix: decode empty body (#1882)
    • fix: graceful shutdown (#1873)
    • fix: fix some typos (#1869)
    • fix: error code judgment (#1849)
    • fix(config/config):fix type not match bug (#1837)

    Chores

    • chore: remove examples (#1871)
    • chore(examples): optimize typos of swagger/server (#1862)

    Others

    • ci: Add 1.18 (#1880)
    • style(cmd/errors/examples/middleware/transport): fix common words' spelling mistakes (#1872)
    • docs: fix some typos (#1852)
    • Example for Polaris (#1850)
    • perf: add prealloc (#1846)
    • build: add matrix strategy with go version (#1845)
    • perf(app): add prealloc (#1843)
    • Discovery For Tencent Polaris (#1839)
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Feb 23, 2022)

    contrib v2.2.0 -> v2.0.0-20220223091357-d6896127b137

    BreakChange

    • jwt.WithClaims accept a func instead of claim interface

    Dependencies

    • deps(thirdparty): clean openapi2 proto (#1826)
    • deps: upgrade go mod version (#1800)

    New Features

    • feat(examples/transaction): add transaction examples (#1836)
    • feat(registry/polaris): add registry for Tencent Polaris (#1816)
    • feat:add examples redirect url (#1807)
    • feature(middleware/jwt): add server custom claims(#1817)

    Bug Fixes

    • fix lint (#1833)
    • fix: add yaml / yml parser (#1808)
    • fix(contrib): get nacos service of customize group name (#1798)
    • fix(config/consul):Config from consul skip empty key (#1830)
    • fix: fix the latest version of lint problem (#1825)
    • fix(cmd/http): warn only when a get or delete request declares a body (#1789)
    • fix: k8s discovery interface (#1820)
    • fix: fix ci tool (#1803)
    • fix: allocates new objects each time (#1802)

    Others

    • update contrib readme (#1831)
    • move container group to internal (#1827)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.5(Jan 24, 2022)

    contrib v2.1.5 -> v2.0.0-20220124072645-9ea78f302d5a

    Dependencies

    • deps: upgrade kratos version to v2.1.5 (#1785)
    • deps(cmd/kratos): Upgrade Cobra 1.2.1 -> v1.3.0 (#1783)

    New Features

    • feat: add logger sdk for aliyun (#1748)
    • feat:add stream interceptor use ctx encapsulation (#1770)
    • feat(log): add global logger appliance, as process level default logger (#1761)
    • feat:sync to gitee where release a version (#1755)
    • feat(middleware/auth/jwt): add customer header (#1752)

    Bug Fixes

    • fix: change consul config docs (#1784)
    • fix: consul heartbeat ttl not registered (#1781)
    • fix: perhaps MISSING (#1779)
    • fixed the problem that grpc stop could not close properly
    • fix:fix log caller error (#1773)
    • fix(cmd/kratos): specified version for upgrade (#1772)
    • fix(cmd/kratos): filepath walk nil pointer reference problem (#1762)
    • fix: change installation package path for protoc-gen-openapi (#1759)

    Others

    • make logger appliance as logger proxy (#1765)
    • test:remove testify go mod (#1766)
    • optimization: optimize global logger (#1763)
    • readme:add log third party log library readme (#1753)
    • upgrade:upgrade grpc and opentelemetry version (#1751)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.4(Jan 5, 2022)

    contrib v2.1.4 -> v2.0.0-20220105083008-7fe194ead489

    New Features

    • feat(registry/consul): add WithHeartbeat option (#1738)
    • feat(examples/):add etcd registry cmux example (#1734)
    • feat(transport):add grpc and http with listen (#1729)
    • feat(cmd/kratos): generating API documentation using Gnostic (#1716)

    Bug Fixes

    • fix: k8s client logr incompatible update (#1744)
    • fix(registry/consul):fix can't get service instance in async mode (#1731)
    • fix(registry/consul): fix can not find service in 20s (#1728)
    • fix: remove the use of client timeout as discovery time (#1715)
    • fix(cmd/kratos): add look protoc-gen-openapi when use kratos proto client (#1726)
    • fix FieldMask are converted to/from lower-camel naming conventions. (#1724)
    • fix(cmd/protoc-gen-go-http): Fix when replacement rule is not ending (#1721)
    • fix: fix typo in cmd/protoc-gen-go-http/http.go(is does not -> does not) (#1718)
    • fix(protoc-gen-go-http): Update http rule when path mappings (#1704)
    • fix(cmd): fixed a camel word enum error
    • fix(cmd/proto-gen-http-go): remove go.mod replace (#1707)

    Others

    • sync to gitee (#1746)
    • upgrade(examples):upgrade go mod version (#1745)
    • test(errors): add errors test (#1739)
    • optimization: optimize error (#1740)
    • test(transport): add transport Listener test (#1735)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.3(Dec 22, 2021)

    contrib 2.1.3 -> v2.0.0-20211222061509-1117350b9c47

    New Features

    • feat(transport/grpc): gRPC client discovery supports incoming logger and timeout (#1702)
    • feat: middleware seletor add ctx match (#1652)
    • feat(registry/nacos): add default kind option (#1650)
    • feat(app): app info delivery to stop context (#1649)

    Bug Fixes

    • fix(cmd/proto-gen-errors): non nil assertion for error (#1700)
    • fix(nacos): call unsubscribe when watching is stopped (#1697)
    • fix(internal/host): fixed network interface is enabled (#1687)
    • fix: init nacos.Register rmd & metada map cap (#1671)
    • fix(config): apollo close function: useless infinite loop causes high cpu usage (#1674)
    • fix: circuitbreaker use client context (#1679)
    • fix: nacos.Register many endpoint metadata kind error (#1664)
    • fix(grpc): Block the RCP unil a new picker is available (#1660)
    • fix: remove cmd replace (#1640)

    Chores

    • chore: completion command in the comment (#1680)

    Others

    • docs: some wrong err msg description
    • consul: support WithServiceResolver option (#1693)
    • transport/http: delay pass context.Context (#1684)
    • registry/nacos: reduce twice string copies (#1681)
    • style: format (#1667)
    • revert to select filters (#1656)
    • optimize:chan bool to chan struct{} (#1648)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.2(Nov 19, 2021)

    contrib 2.1.2 -> v2.0.0-20211119072916-7e0045cd0f2f

    Dependencies

    • deps: upgrade 2.1.2 (#1638)

    New Features

    • feat: upgrade grpc version to 1.42.0 (#1626)
    • feat(form/form): add support google.protobuf.Struct; (#1617)
    • feat(contrib/config): use key file extension as format & config load log (#1619)
    • feat: add base fitler to improve performace (#1612)
    • feat(http): http client support service discovery in Do (#1563)
    • feat: add raw node (#1611)
    • feat: recovery logger with ctx (#1601)
    • feat: add descriptor.proto (#1590)

    Bug Fixes

    • fix: nacos a vulnerable dependency was referenced (#1639)
    • fix doc (#1636)
    • fix:add consul all health check (#1620)
    • fix(cmd/protoc-gen-go-http): follow the http rule to use query strings (#1629)
    • fix(cmd/new): print the correct error message (#1630)
    • fix(middleware/tracing): modify kartos to kratos (#1628)
    • fix[cmd]: if enum is a word in proto file, it should be camel too. (#1618)
    • fix:modify annotation and wrong words (#1615)
    • fix: nacos registry test data race (#1613)
    • fix(cmd/http): fixed cannot declare a route with a regular expression (#1608)
    • fix: k8s nacos and zookeeper registry lint (#1599)
    • fix: fix p2c test (#1607)
    • fix(cmd/kratos): use context timeout control, add timeout param (#1592)
    • fix(app): use new context when app stop (#1589)

    Others

    • Update main.go (#1627)
    • refactor: move from io/ioutil to io and os packages (#1633)
    • docs of etcd config (#1622)
    • docs: replenish config/apollo and registry/discovery readme (#1625)
    • test: add nacos test (#1603)
    • make the output of gin example right (#1598)
    • export selector node (#1606)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Oct 18, 2021)

    Bug Fixes

    • fix(transport/grpc): grpc use global selector which leads to balancer nil error (#1564)
    • fix(cmd/proto-gen-http): cmd http embed message path generate (#1561)
    • fix(http/encoding): encode well known proto types in form and url query (#1559)
    • fix(cmd/proto-gen-http): fix the problem that the field declaration does not exist causing panic (#1553)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Oct 15, 2021)

    New Features

    • feat(loadbalancing): add client load balancing and router selector (#1485)
    • feat(auth): add jwt auth middleware (#1274)
    • feat(circuitbreaker): add client side circuit breaker middleware (#1299)
    • feat(ratelimit): add server side rate limiter middleware (#1271)
    • feat(registry): support discovery registry center (#1480)
    • feat(log): default message key (#1545)
    • feat(config): add config slice map support (#1538)
    • feat: add backupConfigPath method (#1511)

    Bug Fixes

    • fix consul registry TTL. (#1537)
    • fix:etcd prifex find error (#1507)
    • fix:http server start panic when use Endpoint (#1492)

    Dependencies

    • deps: otel upgrade to v1.0.0 (#1500)
    • deps: update go version to 1.16 (#1536)

    Other

    • log.SpanID -> tracing.SpanID
    • log.TraceID -> tracing.TraceID
    Source code(tar.gz)
    Source code(zip)
  • v2.0.5(Aug 16, 2021)

    Bug Fixes

    • fix: proto errors when swagger api import kratos errors (#1348)
    • fix: if not kratos context then panic will result (#1338)
    • fix(cmd/run): command execution directory error (#1336)
    • fix(config): Support colon as default value in config.yaml (#1332)
    • fix:config groutine(watch) leak (#1327)

    Chores

    • chore(config/env): polish watcher (#1341)

    Others

    • optimize: template spaces to tabs (#1352)
    • refactor: optimize the code and use golangci-lint to check for any errors (#1298)
    • add: metadata test (#1324)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.4(Aug 12, 2021)

    New Features

    • feat(cmd/pgh): add processing when generating HTTP code (#1306)
    • feat: kratos tool support generate stream service code (#1284)
    • feat: enhance tracing (#1300)
    • feat: change grpc gateway import path (#1295)
    • feat(endpoint): add endpoint parser (#1273)
    • feat(cmd): support the third party specify by self and fix the warning when third party is not in current directory (#1266)
    • feat(transport): add transport tls config (#1267)

    Bug Fixes

    • fix:etcd<3.13 block question (#1317)
    • fix(config): fix data race (#1316)
    • fix example blog makefile (#1296)
    • fix: using t.TempDir (#1289)
    • fix endpoint panic (#1291)

    Others

    • append config watchers when watch source (#1320)
    • upgrade examples mod dependent version (#1314)
    • upgrade: grpc to v1.39.1 (#1312)
    • add appinfo test (#1293)
    • test: option tests (#1292)
    • ci: add pull request template (#1280)
    • add selector code annotation (#1275)
    • grpc‘s secure discovery (#1270)
    • upgrade kratos to v2.0.3 (#1264)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.3(Jul 27, 2021)

    New Features

    • feat(cmd/upgrade): compatible with go get and go install (#1255)

    Bug Fixes

    • fix(grpc/resolver): fix builder context (#1258)
    • fix(config/env): fix env.load() index out of range (#1252)

    Chores

    • chore(examples/i18n): typo (#1250)
    • chore(examples/registry): add registry tests (#1260)

    Others

    • mod(examples): upgrade consul version (#1261)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.2(Jul 25, 2021)

    New Features

    • feat(cmd/changelog): add chore group (#1217)
    • feat(middleware/selector): add middleware selector (#1244)

    Bug Fixes

    • fix(env): index out panic when env key is preifix (#1247)
    • fix http resovler bug (#1231)
    • fix: using rv directly (#1213)
    • fix(cmd/new): print exception to console (#1227)
    • fix(config): load env and file source order bug (#1220)
    • fix: fixed kratos "new" command #1218 (#1221)

    Chores

    • chore(config/env): minor refactor (#1232)
    • chore(examples/event): examples of increasing use of event (#1228)
    • chore: add zookeeper registry example (#1223)
    • chore: optimize import sort and the short description of run cmd (#1211)
    • chore(typo): fixed document errors in README_ZH (#1209)

    Others

    • add codecov (#1195)
    • repair some misspelling (#1248)
    • style: add gosimple linter and gofmt linter (#1242)
    • mod: clean cmd mod (#1240)
    • mod: upgrade uuid & form (#1239)
    • Revert "replace env underscore to dot (#1229)" (#1235)
    • replace env underscore to dot (#1229)
    • http form array (#1226)
    • support expand config keys (#1224)
    • update WithDecoder comment
    • add zero endpoint protection (#1215)
    • test config struct (#1212)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Jul 18, 2021)

    New Features

    • feat(env): add config env source (#1181)
    • feat(examples/i18n) add i18n example (#1157)
    • feat(config): support Resolver for config variable placeholders (#1135)

    Bug Fixes

    • fix(transport/http): fixed the problem of getting empty node list (#1206)
    • fix(examples/config): fixed spelling mistake (#1186)
    • fix(examples/cors): method misuse (#1184)
    • fix(config): strconv.ParseFloat use correct bitSize
    • fix(cmd/run): fix the problem of looking for the cmd directory outside the project (#1166)

    Others

    • add router group for http server (#1208)
    • add sub router for http
    • use "and" replace "sub" (#1207)
    • add gin examples
    • upgrade consul (#1205)
    • typo: modify the comments of the proto-gen-go-errors (#1204)
    • chore(config/file): add tests for file watcher (#1199)
    • docs: add wechat official account image to the Chinese document (#1190)
    • style(transport): remove duplicate get path code (#1188)
    • docs: default documents points to the english document (#1180)
    • ci(github action): use golangci-lint to replace the deprecated golint (#1175)
    • docs: Added a list of acknowledgments that influence on kratos's design. (#1171)
    • examples: add echo example (#1162)
    • chore(example/blog): add ent tracing, and print the original SQL (#1163)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Jul 8, 2021)

    New Features

    • feat(cmd): add kratos run command and clean code (#1145)
    • feat(cmd): add kratos changelog command (#1140)
    • feat(examples): add benchmark example (#1134)
    • feat: add int/int32/Stringer support when get atomicValue (#1130)

    Bug Fixes

    • fix(cmd/run): fixed a problem that did not run correctly on windows (#1153)
    • fix(cmd): modify the problem of getting length error of kratos run command array (#1150)
    • fix(cmd): fixed a problem where prefix could not be matched in some cases (#1151)
    • fix config decoder (#1142)
    • fix(http): fix error encoder (#1141)
    • fix: kratos run command support to find the cmd directory from the parent directory (#1146)

    Others

    • add form for codec (#1158)
    • add readValue (#1161)
    • add swagger api examples
    • docs: optimization the README.md (#1149)
    • add url for docs (#1147)
    • docs: update readme, add conventional commits #1096 (#1143)
    • add form encoding (#1138)
    • upgrade otel to v1 rc1 (#1132)
    • http stop should use ctx (#1131)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-rc7(Jun 30, 2021)

  • v2.0.0-rc6(Jun 21, 2021)

  • v2.0.0-rc5(Jun 18, 2021)

  • v2.0.0-rc4(Jun 17, 2021)

  • v2.0.0-rc3(Jun 14, 2021)

  • v2.0.0-rc2(Jun 11, 2021)

Owner
Kratos
A Go framework for microservices.
Kratos
Rpcx-framework - An RPC microservices framework based on rpcx, simple and easy to use, ultra fast and efficient, powerful, service discovery, service governance, service layering, version control, routing label registration.

RPCX Framework An RPC microservices framework based on rpcx. Features: simple and easy to use, ultra fast and efficient, powerful, service discovery,

ZYallers 1 Jan 5, 2022
Authentication-microservice - Microservice for user authentication built with golang and gRPC

Authentication-microservice - Microservice for user authentication built with golang and gRPC

Isaque Veras 6 May 30, 2022
Microservice - Microservice golang & nodejs

Microservice Gabungan service dari bahasa pemograman go, nodejs Demo API ms-auth

Didin Tri Anggoro 2 May 21, 2022
Customer-microservice - Microservice of customer built with golang and gRPC

?? Building microservices to manage customer data using Go and gRPC Command to g

Isaque Veras Labs 3 Sep 8, 2022
Microservice - A sample architecture of a microservice in go

#microservice Folder structure required. service certs config config.yaml loggin

null 0 Feb 3, 2022
Modern microservice web framework of golang

gogo gogo is an open source, high performance RESTful api framework for the Golang programming language. It also support RPC api, which is similar to

null 40 May 23, 2022
Kitex byte-dance internal Golang microservice RPC framework with high performance and strong scalability, customized extensions for byte internal.

Kitex 字节跳动内部的 Golang 微服务 RPC 框架,具有高性能、强可扩展的特点,针对字节内部做了定制扩展。

CloudWeGo 5.4k Jan 9, 2023
a microservice framework for rapid development of micro services in Go with rich eco-system

中文版README Go-Chassis is a microservice framework for rapid development of microservices in Go. it focus on helping developer to deliver cloud native a

null 2.6k Dec 27, 2022
Microservice Boilerplate for Golang with gRPC and RESTful API. Multiple database and client supported

Go Microservice Starter A boilerplate for flexible Go microservice. Table of contents Features Installation Todo List Folder Structures Features: Mult

Ahmad Saugi 14 Jul 28, 2022
A microservice gateway developed based on golang.With a variety of plug-ins which can be expanded by itself, plug and play. what's more,it can quickly help enterprises manage API services and improve the stability and security of API services.

Goku API gateway is a microservice gateway developed based on golang. It can achieve the purposes of high-performance HTTP API forwarding, multi tenant management, API access control, etc. it has a powerful custom plug-in system, which can be expanded by itself, and can quickly help enterprises manage API services and improve the stability and security of API services.

Eolink 378 Dec 29, 2022
Trying to build an Ecommerce Microservice in Golang and Will try to make it Cloud Native - Learning Example extending the project of Nic Jackson

Golang Server Project Best Practices Dependency Injection :- In simple words, we want our functions and packages to receive the objects they depend on

Ujjwal Sharma 35 Nov 28, 2022
Golang Caching Microservice (bequant.io test project to get hired)

bequant test project How to use: Simply type docker-compose up -d --build db warden distributor in terminal while in project's directory. MySQL, Warde

Nikita Nikonov 4 May 14, 2022
Microservice to manager users with golang

User Service Microservice to manager users. Assumptions & Limitations This API a

Guilherme Silveira 1 Dec 27, 2021
Golang Microservice making use of protobuf and gRPC as the underlying transport protocol.

Go-Microservices Golang Microservice making use of protobuf and gRPC as the underlying transport protocol. I will be building a generic microservice,

Kathurima Kimathi 0 Jan 5, 2022
Go-rifa-microservice - Clean Architecture template for Golang services

Test CI Go Clean template Clean Architecture template for Golang services Overvi

Evandro Martinelli 1 Sep 22, 2022
This project implements p11-kit RPC server protocol, allowing Go programs to act as a PKCS #11 module without the need for cgo

PKCS #11 modules in Go without cgo This project implements p11-kit RPC server protocol, allowing Go programs to act as a PKCS #11 module without the n

Google 44 Nov 30, 2022
Go gRPC RabbitMQ email microservice

Go, RabbitMQ and gRPC Clean Architecture microservice ?? ??‍?? Full list what has been used: GRPC - gRPC RabbitMQ - RabbitMQ sqlx - Extensions to data

Alexander 144 Dec 29, 2022
A Microservice Toolkit from The New York Times

Gizmo Microservice Toolkit This toolkit provides packages to put together server and pubsub daemons with the following features: Standardized configur

The New York Times 3.7k Jan 7, 2023
Go products microservice

Golang Kafka gRPC MongoDB microservice example ?? ??‍?? Full list what has been used: Kafka - Kafka library in Go gRPC - gRPC echo - Web framework vip

Alexander 108 Dec 28, 2022