1
#pragma once
2

            
3
#include "envoy/extensions/formatter/file_content/v3/file_content.pb.h"
4
#include "envoy/formatter/substitution_formatter_base.h"
5
#include "envoy/server/factory_context.h"
6

            
7
namespace Envoy {
8
namespace Extensions {
9
namespace Formatter {
10

            
11
/**
12
 * CommandParserFactory for the %FILE_CONTENT(/path/to/file)% formatter.
13
 *
14
 * Reads the contents of the specified file and watches for changes on disk,
15
 * so that updates are automatically reflected in subsequent format calls.
16
 */
17
class FileContentFormatterFactory : public Envoy::Formatter::CommandParserFactory {
18
public:
19
  Envoy::Formatter::CommandParserPtr
20
  createCommandParserFromProto(const Protobuf::Message& config,
21
                               Server::Configuration::GenericFactoryContext& context) override;
22
  ProtobufTypes::MessagePtr createEmptyConfigProto() override;
23
  std::string name() const override;
24
};
25

            
26
} // namespace Formatter
27
} // namespace Extensions
28
} // namespace Envoy