1
#include "source/extensions/config_subscription/grpc/xds_source_id.h"
2

            
3
#include "absl/strings/str_cat.h"
4

            
5
namespace Envoy {
6
namespace Config {
7

            
8
XdsConfigSourceId::XdsConfigSourceId(absl::string_view authority_id,
9
                                     absl::string_view resource_type_url)
10
27
    : authority_id_(authority_id), resource_type_url_(resource_type_url) {}
11

            
12
12
std::string XdsConfigSourceId::toKey() const {
13
  // The delimiter between parts of the key. The type URL cannot contain a "+" character, so we
14
  // don't run the risk of collisions with different parts of the key having a "+" in them.
15
12
  static constexpr char DELIMITER[] = "+";
16
12
  return absl::StrCat(authority_id_, DELIMITER, resource_type_url_);
17
12
}
18

            
19
} // namespace Config
20
} // namespace Envoy