Line data Source code
1 : #include "source/common/network/upstream_server_name.h" 2 : 3 : #include "envoy/registry/registry.h" 4 : #include "envoy/stream_info/filter_state.h" 5 : 6 : #include "source/common/common/macros.h" 7 : 8 : namespace Envoy { 9 : namespace Network { 10 : 11 320 : const std::string& UpstreamServerName::key() { 12 320 : CONSTRUCT_ON_FIRST_USE(std::string, "envoy.network.upstream_server_name"); 13 320 : } 14 : 15 : class UpstreamServerNameObjectFactory : public StreamInfo::FilterState::ObjectFactory { 16 : public: 17 69 : std::string name() const override { return UpstreamServerName::key(); } 18 : std::unique_ptr<StreamInfo::FilterState::Object> 19 0 : createFromBytes(absl::string_view data) const override { 20 0 : return std::make_unique<UpstreamServerName>(data); 21 0 : } 22 : }; 23 : 24 : REGISTER_FACTORY(UpstreamServerNameObjectFactory, StreamInfo::FilterState::ObjectFactory); 25 : 26 : } // namespace Network 27 : } // namespace Envoy