userver
C++ Async Framework
Loading...
Searching...
No Matches
mongo_local.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/storages/mongo/utest/mongo_local.hpp
4
/// @brief @copybrief storages::mongo::MongoLocal
5
6
#
include
<
userver
/
storages
/
mongo
/
pool
.
hpp
>
7
8
#
include
<
userver
/
dynamic_config
/
test_helpers
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
storages
::mongo::utest {
13
14
/// @brief Make default pool config for mongo local
15
/// @note This configuration should be used for testing purposes
16
storages
::mongo::PoolConfig
MakeDefaultPoolConfig
();
17
18
/// @brief Mongo local class
19
class
MongoLocal
{
20
public
:
21
/// Mongo local default constructor (use default params)
22
MongoLocal
();
23
24
/// Mongo local constructor with specified params
25
MongoLocal
(std::optional<std::string_view> dbname,
26
std::optional<
storages
::mongo::PoolConfig> pool_config,
27
dynamic_config::Source config_source =
28
dynamic_config
::
GetDefaultSource
(
)
);
29
30
/// Get pool
31
storages
::mongo::PoolPtr
GetPool
()
const
;
32
33
private
:
34
storages
::mongo::PoolPtr pool_;
35
};
36
37
}
// namespace storages::mongo::utest
38
39
USERVER_NAMESPACE_END
userver
storages
mongo
utest
mongo_local.hpp
Generated on Thu Sep 5 2024 11:22:02 for userver by
Doxygen
1.10.0