C++ Server-Side SDK
LaunchDarkly SDK
json_destination.hpp
1 #pragma once
2 
3 #include "../../../include/launchdarkly/server_side/integrations/data_reader/kinds.hpp"
4 #include "../../data_interfaces/destination/idestination.hpp"
5 #include "../../data_interfaces/destination/iserialized_destination.hpp"
6 
7 #include <launchdarkly/logging/logger.hpp>
8 
9 #include <string>
10 
11 namespace launchdarkly::server_side::data_components {
12 
32  public:
40  JsonDestination(Logger const& logger,
42 
47  void Init(data_model::SDKDataSet data_set) override;
48 
58  void Upsert(std::string const& key,
59  data_model::FlagDescriptor flag) override;
60 
70  void Upsert(std::string const& key,
71  data_model::SegmentDescriptor segment) override;
72 
76  [[nodiscard]] std::string const& Identity() const override;
77 
81  struct Kinds {
82  static integrations::FlagKind const Flag;
83  static integrations::SegmentKind const Segment;
84  };
85 
86  private:
87  void LogUpsertResult(
88  std::string const& key,
89  std::string const& data_type,
91  const;
92 
93  Logger const& logger_;
95  std::string const ident_;
96 };
97 
98 } // namespace launchdarkly::server_side::data_components
JsonDestination is responsible for converting flag and segment models into serialized data suitable f...
Definition: json_destination.hpp:31
std::string const & Identity() const override
Definition: json_destination.cpp:68
void Init(data_model::SDKDataSet data_set) override
Initialize the destination with an SDK data set.
Definition: json_destination.cpp:72
JsonDestination(Logger const &logger, data_interfaces::ISerializedDestination &destination)
Construct the JsonDestination with the given ISerializedDestination. Calls to Upsert will trigger ser...
Definition: json_destination.cpp:62
void Upsert(std::string const &key, data_model::FlagDescriptor flag) override
Upsert data for the flag named by key.
Definition: json_destination.cpp:102
IDestination represents a sink for data received by the SDK. A destination may be a database,...
Definition: idestination.hpp:14
This interface is used for persisting data to databases, or any other component that can store featur...
Definition: iserialized_destination.hpp:37
UpsertResult
Definition: iserialized_destination.hpp:51
These are public so they can be referenced in tests.
Definition: json_destination.hpp:81