forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.cc
32 lines (25 loc) · 1.15 KB
/
config.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "extensions/watchdog/profile_action/config.h"
#include "envoy/registry/registry.h"
#include "common/config/utility.h"
#include "common/protobuf/message_validator_impl.h"
#include "extensions/watchdog/profile_action/profile_action.h"
namespace Envoy {
namespace Extensions {
namespace Watchdog {
namespace ProfileAction {
Server::Configuration::GuardDogActionPtr ProfileActionFactory::createGuardDogActionFromProto(
const envoy::config::bootstrap::v3::Watchdog::WatchdogAction& config,
Server::Configuration::GuardDogActionFactoryContext& context) {
auto message = createEmptyConfigProto();
Config::Utility::translateOpaqueConfig(config.config().typed_config(), ProtobufWkt::Struct(),
ProtobufMessage::getStrictValidationVisitor(), *message);
return std::make_unique<ProfileAction>(dynamic_cast<ProfileActionConfig&>(*message), context);
}
/**
* Static registration for the ProfileAction factory. @see RegistryFactory.
*/
REGISTER_FACTORY(ProfileActionFactory, Server::Configuration::GuardDogActionFactory);
} // namespace ProfileAction
} // namespace Watchdog
} // namespace Extensions
} // namespace Envoy