Line data Source code
1 : #pragma once 2 : 3 : #include "envoy/formatter/http_formatter_context.h" 4 : #include "envoy/formatter/substitution_formatter_base.h" 5 : #include "envoy/http/header_map.h" 6 : 7 : namespace Envoy { 8 : namespace Formatter { 9 : 10 : using Formatter = FormatterBase<HttpFormatterContext>; 11 : using FormatterPtr = std::unique_ptr<Formatter>; 12 : using FormatterConstSharedPtr = std::shared_ptr<const Formatter>; 13 : 14 : using FormatterProvider = FormatterProviderBase<HttpFormatterContext>; 15 : using FormatterProviderPtr = std::unique_ptr<FormatterProvider>; 16 : 17 : using CommandParser = CommandParserBase<HttpFormatterContext>; 18 : using CommandParserPtr = std::unique_ptr<CommandParser>; 19 : 20 : /** 21 : * Implemented by each custom CommandParser and registered via Registry::registerFactory() 22 : * or the convenience class RegisterFactory. 23 : * Specialization of CommandParserFactoryBase for HTTP and backwards compatibliity. 24 : */ 25 : template <> class CommandParserFactoryBase<HttpFormatterContext> : public Config::TypedFactory { 26 : public: 27 0 : ~CommandParserFactoryBase() override = default; 28 : 29 : /** 30 : * Creates a particular CommandParser implementation. 31 : * 32 : * @param config supplies the configuration for the command parser. 33 : * @param context supplies the factory context. 34 : * @return CommandParserPtr the CommandParser which will be used in 35 : * SubstitutionFormatParser::parse() when evaluating an access log format string. 36 : */ 37 : virtual CommandParserPtr 38 : createCommandParserFromProto(const Protobuf::Message& config, 39 : Server::Configuration::GenericFactoryContext& context) PURE; 40 : 41 8 : std::string category() const override { return "envoy.formatter"; } 42 : }; 43 : 44 : using CommandParserFactory = CommandParserFactoryBase<HttpFormatterContext>; 45 : 46 : } // namespace Formatter 47 : } // namespace Envoy