userver: userver/storages/mongo/utest/mongo_local.hpp Source File
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
10USERVER_NAMESPACE_BEGIN
11
12namespace storages::mongo::utest {
13
14/// @brief Make default pool config for mongo local
15/// @note This configuration should be used for testing purposes
16storages::mongo::PoolConfig MakeDefaultPoolConfig();
17
18/// @brief Mongo local class
20public:
21 /// Mongo local default constructor (use default params)
23
24 /// Mongo local constructor with specified params
26 std::optional<std::string_view> dbname,
27 std::optional<storages::mongo::PoolConfig> pool_config,
28 dynamic_config::Source config_source = dynamic_config::GetDefaultSource()
29 );
30
31 /// Get pool
32 storages::mongo::PoolPtr GetPool() const;
33
34private:
35 storages::mongo::PoolPtr pool_;
36};
37
38} // namespace storages::mongo::utest
39
40USERVER_NAMESPACE_END