Skip to content

Commit

Permalink
remove StreamMiddleware from middleware and replace options for clien…
Browse files Browse the repository at this point in the history
…t stream interface with streamMiddleware
  • Loading branch information
akoserwal committed Sep 6, 2024
1 parent b65b7e2 commit 93484a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ func Chain(m ...Middleware) Middleware {
return next
}
}

type StreamMiddleware func(Handler) Handler
3 changes: 2 additions & 1 deletion transport/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ type clientOptions struct {
timeout time.Duration
discovery registry.Discovery
middleware []middleware.Middleware
streamMiddleware []middleware.Middleware
ints []grpc.UnaryClientInterceptor
streamInts []grpc.StreamClientInterceptor
grpcOpts []grpc.DialOption
Expand Down Expand Up @@ -167,7 +168,7 @@ func dial(ctx context.Context, insecure bool, opts ...ClientOption) (*grpc.Clien
unaryClientInterceptor(options.middleware, options.timeout, options.filters),
}
sints := []grpc.StreamClientInterceptor{
streamClientInterceptor(options.middleware, options.filters),
streamClientInterceptor(options.streamMiddleware, options.filters),
}

if len(options.ints) > 0 {
Expand Down

0 comments on commit 93484a9

Please sign in to comment.