1
#pragma once
2

            
3
#include "envoy/common/optref.h"
4
#include "envoy/common/pure.h"
5

            
6
namespace Envoy {
7
namespace Config {
8

            
9
/**
10
 * A provider for extension configurations obtained either statically or via
11
 * the extension configuration discovery service. Dynamically updated extension
12
 * configurations may share subscriptions across extension config providers.
13
 */
14
template <class FactoryCallback> class ExtensionConfigProvider {
15
public:
16
28173
  virtual ~ExtensionConfigProvider() = default;
17

            
18
  /**
19
   * Get the extension configuration resource name.
20
   **/
21
  virtual const std::string& name() PURE;
22

            
23
  /**
24
   * @return FactoryCallback an extension factory callback. Note that if the
25
   * provider has not yet performed an initial configuration load and no
26
   * default is provided, an empty optional will be returned. The factory
27
   * callback is the latest version of the extension configuration, and should
28
   * generally apply only to new requests and connections.
29
   */
30
  virtual OptRef<FactoryCallback> config() PURE;
31
};
32

            
33
} // namespace Config
34
} // namespace Envoy