Line data Source code
1 : #include "source/extensions/formatter/cel/config.h" 2 : 3 : #include "envoy/extensions/formatter/cel/v3/cel.pb.h" 4 : 5 : #include "source/extensions/formatter/cel/cel.h" 6 : 7 : namespace Envoy { 8 : namespace Extensions { 9 : namespace Formatter { 10 : 11 : ::Envoy::Formatter::CommandParserPtr CELFormatterFactory::createCommandParserFromProto( 12 0 : const Protobuf::Message&, Server::Configuration::GenericFactoryContext& context) { 13 0 : #if defined(USE_CEL_PARSER) 14 0 : return std::make_unique<CELFormatterCommandParser>(context.serverFactoryContext()); 15 : #else 16 : UNREFERENCED_PARAMETER(context); 17 : throw EnvoyException("CEL is not available for use in this environment."); 18 : #endif 19 0 : } 20 : 21 1 : ProtobufTypes::MessagePtr CELFormatterFactory::createEmptyConfigProto() { 22 1 : return std::make_unique<envoy::extensions::formatter::cel::v3::Cel>(); 23 1 : } 24 : 25 38 : std::string CELFormatterFactory::name() const { return "envoy.formatter.cel"; } 26 : 27 : REGISTER_FACTORY(CELFormatterFactory, ::Envoy::Formatter::CommandParserFactory); 28 : 29 : } // namespace Formatter 30 : } // namespace Extensions 31 : } // namespace Envoy