diff --git a/examples/README.md b/examples/README.md index 42c34b052..87458e3a4 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1 +1,14 @@ # examples + +- examples/blog is simple crud project. +- examples/config is kratos config example. +- examples/errors is kratos errors example, it is generated through proto-gen-go-errors. +- examples/helloworld is helloworld example. +- examples/http is transport/http some examples of usage. +- examples/log is log example, including、logger、helper、filter、valuer, etc. +- examples/metadata is metadata example. +- examples/metrics is metrics example, in the example, prom is used to collect data. +- examples/registry is registration and discovery examples,including Etcd, Consul, Nacos. +- examples/traces is middleware/tracing example,middleware/tracing is implemented by opentelemetry. +- examples/validate is middleware/validate example, the verification code is generated by proto-gen-validate. +- examples/ws is implementation of transport interface with websocket example. diff --git a/examples/helloworld/client/main.go b/examples/helloworld/client/main.go index 0453d9f1b..1a6a39811 100644 --- a/examples/helloworld/client/main.go +++ b/examples/helloworld/client/main.go @@ -6,7 +6,6 @@ import ( pb "github.com/go-kratos/kratos/examples/helloworld/helloworld" "github.com/go-kratos/kratos/v2/errors" - "github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/middleware/recovery" transgrpc "github.com/go-kratos/kratos/v2/transport/grpc" transhttp "github.com/go-kratos/kratos/v2/transport/http" @@ -50,9 +49,7 @@ func callGRPC() { context.Background(), transgrpc.WithEndpoint("127.0.0.1:9000"), transgrpc.WithMiddleware( - middleware.Chain( - recovery.Recovery(), - ), + recovery.Recovery(), ), ) if err != nil {