/// <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); }
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); }
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); }
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); }
public static IMicropartServiceCollection AddHttpHealthCheckOfAspNetCore(this IMicropartServiceCollection micropartServiceCollection) { var serviceCollection = micropartServiceCollection.ApplicationServiceCollection; return(micropartServiceCollection); }