1
#pragma once
2

            
3
#include <string>
4

            
5
#include "envoy/http/request_id_extension.h"
6
#include "envoy/server/filter_config.h"
7

            
8
#include "source/common/protobuf/protobuf.h"
9

            
10
namespace Envoy {
11
namespace Server {
12
namespace Configuration {
13

            
14
/**
15
 * Implemented for each RequestIDExtension and registered via Registry::registerFactory
16
 * or the convenience class RegisterFactory.
17
 */
18
class RequestIDExtensionFactory : public Envoy::Config::TypedFactory {
19
public:
20
  ~RequestIDExtensionFactory() override = default;
21

            
22
  /**
23
   * Create a Request ID Extension instance from the provided config proto.
24
   * @param config the custom configuration for this request id extension type.
25
   * @param context general filter context through which persistent resources can be accessed.
26
   */
27
  virtual Http::RequestIDExtensionSharedPtr createExtensionInstance(const Protobuf::Message& config,
28
                                                                    FactoryContext& context) PURE;
29

            
30
1103
  std::string category() const override { return "envoy.request_id"; }
31
};
32

            
33
} // namespace Configuration
34
} // namespace Server
35
} // namespace Envoy