Line data Source code
1 : #pragma once 2 : 3 : #include "envoy/config/core/v3/health_check.pb.h" 4 : #include "envoy/extensions/health_checkers/redis/v3/redis.pb.h" 5 : #include "envoy/extensions/health_checkers/redis/v3/redis.pb.validate.h" 6 : 7 : #include "source/common/config/utility.h" 8 : #include "source/common/protobuf/protobuf.h" 9 : #include "source/common/protobuf/utility.h" 10 : 11 : namespace Envoy { 12 : namespace Extensions { 13 : namespace HealthCheckers { 14 : namespace RedisHealthChecker { 15 : 16 : namespace { 17 : 18 : static const envoy::extensions::health_checkers::redis::v3::Redis 19 : getRedisHealthCheckConfig(const envoy::config::core::v3::HealthCheck& health_check_config, 20 0 : ProtobufMessage::ValidationVisitor& validation_visitor) { 21 0 : ProtobufTypes::MessagePtr config = 22 0 : ProtobufTypes::MessagePtr{new envoy::extensions::health_checkers::redis::v3::Redis()}; 23 0 : Envoy::Config::Utility::translateOpaqueConfig( 24 0 : health_check_config.custom_health_check().typed_config(), validation_visitor, *config); 25 0 : return MessageUtil::downcastAndValidate< 26 0 : const envoy::extensions::health_checkers::redis::v3::Redis&>(*config, validation_visitor); 27 0 : } 28 : 29 : } // namespace 30 : } // namespace RedisHealthChecker 31 : } // namespace HealthCheckers 32 : } // namespace Extensions 33 : } // namespace Envoy