feat: add middlewares config for zrpc (#2766)

* feat: add middlewares config for zrpc

* chore: add tests

* chore: improve codecov

* chore: improve codecov
This commit is contained in:
Kevin Wan
2023-01-08 19:34:05 +08:00
committed by GitHub
parent ade6f9ee46
commit 26c541b9cb
13 changed files with 272 additions and 53 deletions

View File

@@ -76,6 +76,13 @@ func TestDepositServer_Deposit(t *testing.T) {
App: "foo",
Token: "bar",
Timeout: 1000,
Middlewares: ClientMiddlewaresConf{
Trace: true,
Duration: true,
Prometheus: true,
Breaker: true,
Timeout: true,
},
},
WithDialOption(grpc.WithContextDialer(dialer())),
WithUnaryClientInterceptor(func(ctx context.Context, method string, req, reply interface{},
@@ -90,6 +97,13 @@ func TestDepositServer_Deposit(t *testing.T) {
Token: "bar",
Timeout: 1000,
NonBlock: true,
Middlewares: ClientMiddlewaresConf{
Trace: true,
Duration: true,
Prometheus: true,
Breaker: true,
Timeout: true,
},
},
WithDialOption(grpc.WithContextDialer(dialer())),
WithUnaryClientInterceptor(func(ctx context.Context, method string, req, reply interface{},
@@ -103,6 +117,13 @@ func TestDepositServer_Deposit(t *testing.T) {
App: "foo",
Token: "bar",
Timeout: 1000,
Middlewares: ClientMiddlewaresConf{
Trace: true,
Duration: true,
Prometheus: true,
Breaker: true,
Timeout: true,
},
},
WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())),
WithDialOption(grpc.WithContextDialer(dialer())),