File tree Expand file tree Collapse file tree
scripts/docs/en/userver/grpc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66There are two main interfaces for implementing a middleware:
771 . @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
Original file line number Diff line number Diff line change 11# gRPC middlewares configuration
22
33If 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
Original file line number Diff line number Diff line change 44
55There are two main interfaces for implementing a middleware:
661 . @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
170176To fully understand what happens when middlewares hooks fail, you should understand the middlewares order:
You can’t perform that action at this time.
0 commit comments