예제 #1
0
        /// <summary>
        /// inject configurationCenter
        /// </summary>
        /// <param name="micropartServiceCollection"></param>
        /// <returns></returns>
        public static IMicropartServiceCollection AddConfigurationCenterOfConsul(this IMicropartServiceCollection micropartServiceCollection)
        {
            var serviceCollection = micropartServiceCollection.ApplicationServiceCollection;

            serviceCollection.AddSingleton <IMicropartOfConfigurationCenter, MicropartOfConfigurationCenter>();
            serviceCollection.AddSingleton <IMicroPartInfo, MicropartInfoOfConfigurationCenter>();
            return(micropartServiceCollection);
        }
예제 #2
0
        public static IMicropartServiceCollection AddRabbitMqAsEventBus(this IMicropartServiceCollection micropartServiceCollection)
        {
            var serviceCollection = micropartServiceCollection.ApplicationServiceCollection;

            serviceCollection.AddSingleton <IMicroPartInfo, MicropartInfoOfEventBus>();
            serviceCollection.AddSingleton <IMicropartOfEventBus, MicropartOfEventBus>();
            serviceCollection.AddSingleton <IMicropartOfEventBusStartup, MicropartOfEventBusStartup>();
            return(micropartServiceCollection);
        }
예제 #3
0
        public static IMicropartServiceCollection AddLogOfNLog(this IMicropartServiceCollection micropartServiceCollection)
        {
            var serviceCollection = micropartServiceCollection.ApplicationServiceCollection;

            serviceCollection.AddLogging();

            serviceCollection.AddSingleton <ILoggerFactory, LoggerFactory>();
            serviceCollection.AddSingleton(typeof(ILogger <>), typeof(Logger <>));
            serviceCollection.AddLogging((builder) => builder.SetMinimumLevel(LogLevel.Trace));

            serviceCollection.AddSingleton <IMicroPartInfo, MicropartInfoOfNLog>();
            return(micropartServiceCollection);
        }
예제 #4
0
        public static IMicropartServiceCollection AddCallTreeOfZipkin(this IMicropartServiceCollection micropartServiceCollection)
        {
            var serviceCollection = micropartServiceCollection.ApplicationServiceCollection;

            serviceCollection.AddSingleton <IConsumerCallTree, ConsumerCallTree>();
            serviceCollection.AddSingleton <IOperationCallTree, OperationCallTree>();
            serviceCollection.AddSingleton <IProducerCallTree, ProducerCallTree>();

            serviceCollection.AddSingleton <TracingHttpDelegatingHandle, TracingHttpDelegatingHandleOfZipkin>();
            serviceCollection.AddSingleton <IMicropartOfCallTreeStartup, MicropartOfZipkinStartup>();
            serviceCollection.AddSingleton <IMicropartOfCallTree, MicroPartOfZipkin>();
            serviceCollection.AddSingleton <IMicroPartInfo, MicropartInfoOfZipkin>();
            return(micropartServiceCollection);
        }
예제 #5
0
        public static IMicropartServiceCollection AddHttpHealthCheckOfAspNetCore(this IMicropartServiceCollection micropartServiceCollection)
        {
            var serviceCollection = micropartServiceCollection.ApplicationServiceCollection;

            return(micropartServiceCollection);
        }