#include <userver/ugrpc/tests/service.hpp>
template<typename GrpcService>
class ugrpc::tests::Service< GrpcService >
Sets up a mini gRPC server using a single service implementation.
- See also
- ugrpc::tests::ServiceBase
Definition at line 116 of file service.hpp.
|
| | Service () |
| | Default-constructs the service.
|
| |
| template<typename... Args> |
| | Service (std::in_place_t, Args &&... args) |
| | Passes args to the service.
|
| |
| template<typename... Args> |
| | Service (server::ServerConfig &&server_config, std::in_place_t=std::in_place, Args &&... args) |
| | Passes args to the service, server_config to ServiceBase::ServiceBase.
|
| |
| template<typename... Args> |
| | Service (server::ServerConfig &&server_config, server::Middlewares server_middlewares, client::Middlewares client_middlewares, std::in_place_t=std::in_place, Args &&... args) |
| | Passes args to the service, server_config to ServiceBase::ServiceBase, sets custom middlewares.
|
| |
| GrpcService & | GetService () |
| |
| void | RegisterService (server::ServiceBase &service) |
| |
|
void | RegisterService (server::GenericServiceBase &service) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
| void | StartServer (client::ClientFactorySettings &&settings={}) |
| |
| void | StopServer () noexcept |
| |
| template<typename Client> |
| Client | MakeClient () |
| |
| server::Server & | GetServer () noexcept |
| |
|
void | SetServerMiddlewares (server::Middlewares middlewares) |
| | Server middlewares can be modified before the first RegisterService call.
|
| |
|
void | SetClientMiddlewares (client::Middlewares middlewares) |
| | Client middlewares can be modified before the first RegisterService call.
|
| |
| void | ExtendDynamicConfig (const std::vector< dynamic_config::KeyValue > &) |
| |
| dynamic_config::Source | GetConfigSource () const |
| |
| utils::statistics::Storage & | GetStatisticsStorage () |
| |
◆ Service() [1/4]
template<typename GrpcService>
Default-constructs the service.
Definition at line 119 of file service.hpp.
◆ Service() [2/4]
template<typename GrpcService>
template<typename... Args>
Passes args to the service.
Definition at line 125 of file service.hpp.
◆ Service() [3/4]
template<typename GrpcService>
template<typename... Args>
Passes args to the service, server_config to ServiceBase::ServiceBase.
Definition at line 131 of file service.hpp.
◆ Service() [4/4]
template<typename GrpcService>
template<typename... Args>
Passes args to the service, server_config to ServiceBase::ServiceBase, sets custom middlewares.
Definition at line 143 of file service.hpp.
◆ ~Service()
template<typename GrpcService>
◆ ExtendDynamicConfig()
Modifies the internal dynamic configs storage. It is used by the server and clients, and is accessible through GetConfigSource. Initially, the configs are filled with compile-time defaults.
◆ GetConfigSource()
◆ GetServer()
◆ GetService()
template<typename GrpcService>
- Returns
- the stored service.
Definition at line 162 of file service.hpp.
◆ GetStatisticsStorage()
- Returns
- the statistics storage used by the server and clients.
◆ MakeClient()
template<typename Client>
| Client ugrpc::tests::ServiceBase::MakeClient |
( |
| ) |
|
|
inlineinherited |
- Returns
- a client for the specified gRPC service, connected to the server.
Definition at line 59 of file service.hpp.
◆ RegisterService()
Register a gRPC service implementation. The caller owns the service and should ensure that the services live at least until StopServer is called.
◆ StartServer()
Starts the server and connects a grpc channel to it. Should be called after the services are registered.
◆ StopServer()
| void ugrpc::tests::ServiceBase::StopServer |
( |
| ) |
|
|
noexceptinherited |
Should be called before the registered services are destroyed. Should typically be called in the destructor of your gtest fixture.
The documentation for this class was generated from the following file: