C++ Client-Side SDK
LaunchDarkly SDK
config_builder.hpp
1 #pragma once
2 
3 #include <launchdarkly/config/shared/builders/app_info_builder.hpp>
4 #include <launchdarkly/config/shared/builders/data_source_builder.hpp>
5 #include <launchdarkly/config/shared/builders/endpoints_builder.hpp>
6 #include <launchdarkly/config/shared/builders/events_builder.hpp>
7 #include <launchdarkly/config/shared/builders/http_properties_builder.hpp>
8 #include <launchdarkly/config/shared/builders/logging_builder.hpp>
9 #include <launchdarkly/config/shared/builders/persistence_builder.hpp>
10 #include <launchdarkly/config/shared/config.hpp>
11 
12 #include <optional>
13 #include <string>
14 
15 #include "tl/expected.hpp"
16 
17 namespace launchdarkly::config::shared::builders {
18 
24 template <typename SDK>
26  public:
27  using Result = Config<SDK>;
28  using EndpointsBuilder =
30  using EventsBuilder =
32  using DataSourceBuilder =
34  using HttpPropertiesBuilder =
36  using PersistenceBuilder =
38  using LoggingBuilder =
40 
45  explicit ConfigBuilder(std::string sdk_key);
46 
54 
62 
69  ConfigBuilder& Offline(bool offline);
70 
78 
86 
94 
101 
108 
113  tl::expected<Result, Error> Build() const;
114 
115  private:
116  std::string sdk_key_;
117  std::optional<bool> offline_;
118 
119  EndpointsBuilder service_endpoints_builder_;
120  AppInfoBuilder app_info_builder_;
121  EventsBuilder events_builder_;
122  DataSourceBuilder data_source_builder_;
123  HttpPropertiesBuilder http_properties_builder_;
124  LoggingBuilder logging_config_builder_;
125  PersistenceBuilder persistence_builder_;
126 };
127 
128 } // namespace launchdarkly::config::shared::builders
PersistenceBuilder & Persistence()
Definition: config_builder.cpp:50
LoggingBuilder & Logging()
Definition: config_builder.cpp:45
ConfigBuilder & Offline(bool offline)
Definition: config_builder.cpp:27
DataSourceBuilder & DataSource()
Definition: config_builder.cpp:34
tl::expected< Result, Error > Build() const
Definition: config_builder.cpp:56
ConfigBuilder(std::string sdk_key)
Definition: config_builder.cpp:7
AppInfoBuilder & AppInfo()
Definition: config_builder.cpp:22
HttpPropertiesBuilder & HttpProperties()
Definition: config_builder.cpp:40
EventsBuilder & Events()
Definition: config_builder.cpp:17
EndpointsBuilder & ServiceEndpoints()
Definition: config_builder.cpp:12
Definition: data_source_builder.hpp:17
Definition: http_properties_builder.hpp:74
Definition: config.hpp:20