hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
postgres_options.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_POSTGRES_OPTIONS_HPP
7 #define IROHA_POSTGRES_OPTIONS_HPP
8 
9 #include <unordered_map>
10 #include "common/result.hpp"
11 #include "logger/logger_fwd.hpp"
12 
13 namespace iroha {
14  namespace ametsuchi {
15 
20  public:
29  PostgresOptions(const std::string &pg_opt,
30  std::string default_dbname,
31  logger::LoggerPtr log);
32 
44  PostgresOptions(const std::string &host,
45  uint16_t port,
46  const std::string &user,
47  const std::string &password,
48  const std::string &working_dbname,
49  const std::string &maintenance_dbname,
50  logger::LoggerPtr log);
51 
53  std::string connectionStringWithoutDbName() const;
54 
56  std::string workingConnectionString() const;
57 
59  std::string maintenanceConnectionString() const;
60 
62  std::string workingDbName() const;
63 
65  std::string maintenanceDbName() const;
66 
68  const std::string &preparedBlockName() const;
69 
70  private:
71  std::string getConnectionStringWithDbName(
72  const std::string &dbname) const;
73 
74  const std::string host_;
75  const uint16_t port_;
76  const std::string user_;
77  const std::string password_;
78  const std::string working_dbname_;
79  const std::string maintenance_dbname_;
80  const std::string prepared_block_name_;
81  };
82 
83  } // namespace ametsuchi
84 } // namespace iroha
85 
86 #endif // IROHA_POSTGRES_OPTIONS_HPP
Definition: postgres_options.hpp:19
std::string workingDbName() const
Definition: postgres_options.cpp:107
std::string connectionStringWithoutDbName() const
Definition: postgres_options.cpp:88
std::string maintenanceDbName() const
Definition: postgres_options.cpp:111
const std::string & preparedBlockName() const
Definition: postgres_options.cpp:115
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
PostgresOptions(const std::string &pg_opt, std::string default_dbname, logger::LoggerPtr log)
Definition: postgres_options.cpp:54
std::string maintenanceConnectionString() const
Definition: postgres_options.cpp:98
Definition: block_query.hpp:14
std::string workingConnectionString() const
Definition: postgres_options.cpp:94