Skip to content

Commit d493fe8

Browse files
committed
fix docs: notice about MiddlewareFactoryComponent
commit_hash:9d46df8b86e1f8bcb30109d0d8da652f599378a0
1 parent a0ded23 commit d493fe8

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

scripts/docs/en/userver/grpc/client_middleware_implementation.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
There are two main interfaces for implementing a middleware:
77
1. @ref ugrpc::client::MiddlewareBase. Class that implements the main logic of a middleware.
8-
2. @ref ugrpc::client::MiddlewareFactoryComponentBase The factory for the middleware to declare static options.
9-
* Or for simple cases without static options @ref ugrpc::client::SimpleMiddlewareFactoryComponent.
8+
2. @ref ugrpc::client::SimpleMiddlewareFactoryComponent short-cut for simple cases without static options.
9+
* Or @ref ugrpc::client::MiddlewareFactoryComponentBase to declare static options.
1010

1111
## MiddlewareBase
1212

@@ -177,7 +177,12 @@ These hooks are called on each message.
177177
@snippet grpc/src/ugrpc/client/middlewares/log/middleware.hpp MiddlewareBase example declaration
178178
@snippet grpc/src/ugrpc/client/middlewares/log/middleware.cpp MiddlewareBase Message methods example
179179

180-
The static YAML config and component registration are identical as in example above. So, let's not focus on this.
180+
The static YAML config and component registration are identical as in the example above. So, let's not focus on this.
181+
182+
## MiddlewareFactoryComponent
183+
184+
We use a simple short-cut @ref ugrpc::client::SimpleMiddlewareFactoryComponent in the example above.
185+
To declare static config options of your middleware see @ref scripts/docs/en/userver/grpc/middlewares_configuration.md.
181186

182187
## Exceptions and errors in middlewares
183188

scripts/docs/en/userver/grpc/middlewares_configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# gRPC middlewares configuration
22

33
If your middleware doesn't have static config options, just use:
4-
1. @ref ugrpc::server::SimpleMiddlewareFactoryComponent
5-
2. @ref ugrpc::client::SimpleMiddlewareFactoryComponent
4+
1. @ref ugrpc::server::SimpleMiddlewareFactoryComponent and see @ref scripts/docs/en/userver/grpc/server_middleware_implementation.md
5+
2. @ref ugrpc::client::SimpleMiddlewareFactoryComponent and see @ref scripts/docs/en/userver/grpc/client_middleware_implementation.md
66

77
## Yaml config for a middleware
88

scripts/docs/en/userver/grpc/server_middlewares_implementation.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
There are two main interfaces for implementing a middleware:
66
1. @ref ugrpc::server::MiddlewareBase. Class that implements the main logic of a middleware
7-
2. @ref ugrpc::server::MiddlewareFactoryComponentBase. The factory for the middleware to declare static options.
8-
* Or for simple cases without static options @ref ugrpc::server::SimpleMiddlewareFactoryComponent.
7+
2. @ref ugrpc::server::SimpleMiddlewareFactoryComponent short-cut for simple cases without static options.
8+
* Or @ref ugrpc::server::MiddlewareFactoryComponentBase to declare static options.
99

1010
## MiddlewareBase
1111

@@ -165,6 +165,12 @@ Register the middleware component in the component system.
165165

166166
@snippet grpc/functional_tests/middleware_server/src/main.cpp Register middlewares
167167

168+
169+
## MiddlewareFactoryComponent
170+
171+
We use a simple short-cut @ref ugrpc::server::SimpleMiddlewareFactoryComponent in the example above.
172+
To declare static config options of your middleware see @ref scripts/docs/en/userver/grpc/middlewares_configuration.md.
173+
168174
## Exceptions and errors in middlewares
169175

170176
To fully understand what happens when middlewares hooks fail, you should understand the middlewares order:

0 commit comments

Comments
 (0)