Line data Source code
1 : #include "source/extensions/watchdog/profile_action/config.h" 2 : 3 : #include "envoy/registry/registry.h" 4 : 5 : #include "source/common/config/utility.h" 6 : #include "source/common/protobuf/message_validator_impl.h" 7 : #include "source/extensions/watchdog/profile_action/profile_action.h" 8 : 9 : namespace Envoy { 10 : namespace Extensions { 11 : namespace Watchdog { 12 : namespace ProfileAction { 13 : 14 : Server::Configuration::GuardDogActionPtr ProfileActionFactory::createGuardDogActionFromProto( 15 : const envoy::config::bootstrap::v3::Watchdog::WatchdogAction& config, 16 0 : Server::Configuration::GuardDogActionFactoryContext& context) { 17 0 : auto message = createEmptyConfigProto(); 18 0 : Config::Utility::translateOpaqueConfig(config.config().typed_config(), 19 0 : ProtobufMessage::getStrictValidationVisitor(), *message); 20 0 : return std::make_unique<ProfileAction>(dynamic_cast<ProfileActionConfig&>(*message), context); 21 0 : } 22 : 23 : /** 24 : * Static registration for the ProfileAction factory. @see RegistryFactory. 25 : */ 26 : REGISTER_FACTORY(ProfileActionFactory, Server::Configuration::GuardDogActionFactory); 27 : 28 : } // namespace ProfileAction 29 : } // namespace Watchdog 30 : } // namespace Extensions 31 : } // namespace Envoy