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
56197
const std::string& UpstreamServerName::key() {
12
56197
  CONSTRUCT_ON_FIRST_USE(std::string, "envoy.network.upstream_server_name");
13
56197
}
14

            
15
class UpstreamServerNameObjectFactory : public StreamInfo::FilterState::ObjectFactory {
16
public:
17
1673
  std::string name() const override { return UpstreamServerName::key(); }
18
  std::unique_ptr<StreamInfo::FilterState::Object>
19
2
  createFromBytes(absl::string_view data) const override {
20
2
    return std::make_unique<UpstreamServerName>(data);
21
2
  }
22
};
23

            
24
REGISTER_FACTORY(UpstreamServerNameObjectFactory, StreamInfo::FilterState::ObjectFactory);
25

            
26
} // namespace Network
27
} // namespace Envoy