Line data Source code
1 : #include "source/extensions/access_loggers/grpc/config_utils.h" 2 : 3 : #include "envoy/singleton/manager.h" 4 : 5 : namespace Envoy { 6 : namespace Extensions { 7 : namespace AccessLoggers { 8 : namespace GrpcCommon { 9 : 10 : // Singleton registration via macro defined in envoy/singleton/manager.h 11 : SINGLETON_MANAGER_REGISTRATION(grpc_access_logger_cache); 12 : 13 : GrpcCommon::GrpcAccessLoggerCacheSharedPtr 14 0 : getGrpcAccessLoggerCacheSingleton(Server::Configuration::CommonFactoryContext& context) { 15 0 : return context.singletonManager().getTyped<GrpcCommon::GrpcAccessLoggerCacheImpl>( 16 0 : SINGLETON_MANAGER_REGISTERED_NAME(grpc_access_logger_cache), [&context] { 17 0 : return std::make_shared<GrpcCommon::GrpcAccessLoggerCacheImpl>( 18 0 : context.clusterManager().grpcAsyncClientManager(), context.serverScope(), 19 0 : context.threadLocal(), context.localInfo()); 20 0 : }); 21 0 : } 22 : } // namespace GrpcCommon 23 : } // namespace AccessLoggers 24 : } // namespace Extensions 25 : } // namespace Envoy