public static IAppBuilder UseHealthNet(
     this IAppBuilder appBuilder,
     IHealthNetConfiguration configuration,
     Func <IEnumerable <ISystemChecker> > systemCheckerResolver)
 {
     return(appBuilder.UseHealthNet(configuration, new AssemblyFileVersionProvider(configuration), systemCheckerResolver));
 }
Пример #2
0
 public HealthCheckService(IHealthNetConfiguration healthNetConfiguration, IVersionProvider versionProvider,
                           IEnumerable <ISystemChecker> systemStateCheckers)
 {
     this.healthNetConfiguration = healthNetConfiguration;
     this.versionProvider        = versionProvider;
     this.systemStateCheckers    = systemStateCheckers;
 }
Пример #3
0
 public DependencyResolver(IHealthNetConfiguration configuration,
                           IVersionProvider versionProvider, IEnumerable <ISystemChecker> checkers)
 {
     this.configuration   = configuration;
     this.versionProvider = versionProvider;
     this.checkers        = checkers;
 }
Пример #4
0
 public IAppBuilder Configure(IAppBuilder app, IHealthNetConfiguration configuration, IEnumerable <ISystemChecker> checkers)
 {
     return(app.UseHealthNet(configuration, () =>
     {
         var systemCheckers = checkers as ISystemChecker[] ?? checkers.ToArray();
         return systemCheckers;
     }));
 }
Пример #5
0
 public IAppBuilder Configure(IAppBuilder app, IHealthNetConfiguration configuration, IEnumerable<ISystemChecker> checkers)
 {
     return app.UseHealthNet(configuration, () =>
     {
         var systemCheckers = checkers as ISystemChecker[] ?? checkers.ToArray();
         return systemCheckers;
     });
 }
Пример #6
0
 public IAppBuilder Configure(IAppBuilder app, IHealthNetConfiguration healthNetConfiguration, IEnumerable<ISystemChecker> checkers)
 {
     return app
         .UseNancy(x =>
             x.Bootstrapper =
                 new ConfigurableBootstrapper(
                     y => y.Module<HealthNetModule>().Module<FooModule>().DisableAutoRegistrations().Dependency(checkers).Dependency(healthNetConfiguration)));
 }
Пример #7
0

        
Пример #8
0
 public HealthCheckController(
     IHealthNetConfiguration configuration,
     IVersionProvider versionProvider,
     IEnumerable <ISystemChecker> checkers)
 {
     this.configuration   = configuration;
     this.versionProvider = versionProvider;
     this.checkers        = checkers;
 }
Пример #9
0
 public HealthNetMiddleware(AppFunc next,
                            IHealthNetConfiguration configuration,
                            IVersionProvider versionProvider,
                            Func <IEnumerable <ISystemChecker> > systemCheckerResolverFactory)
 {
     this.next            = next;
     this.configuration   = configuration;
     this.versionProvider = versionProvider;
     this.systemCheckerResolverFactory = systemCheckerResolverFactory;
 }
Пример #10
0
        public static IAppBuilder UseHealthNet(
            this IAppBuilder appBuilder,
            IHealthNetConfiguration configuration,
            IVersionProvider versionProvider,
            Func <IEnumerable <ISystemChecker> > systemCheckerResolver)
        {
            appBuilder.Use(typeof(HealthNetMiddleware), configuration, versionProvider, systemCheckerResolver);

            return(appBuilder);
        }
Пример #11
0
        public IAppBuilder Configure(IAppBuilder app, IHealthNetConfiguration configuration, IEnumerable<ISystemChecker> checkers)
        {
            var httpConfiguration = new HttpConfiguration();
            httpConfiguration.Routes.MapHttpRoute(
                routeTemplate: configuration.Path.Remove(0, 1),
                name: "HealthCheck",
                defaults: new { Controller = "HealthCheck" }
                );

            var assemblyResolver = new AssembliesResolver();
            httpConfiguration.Services.Replace(typeof(IAssembliesResolver), assemblyResolver);

            httpConfiguration.DependencyResolver = new DependencyResolver(configuration, checkers);

            return app.UseWebApi(httpConfiguration);
        }
Пример #12
0
        public IAppBuilder Configure(IAppBuilder app, IHealthNetConfiguration configuration, IEnumerable <ISystemChecker> checkers)
        {
            var httpConfiguration = new HttpConfiguration();

            httpConfiguration.Routes.MapHttpRoute(
                routeTemplate: configuration.Path.Remove(0, 1),
                name: "HealthCheck",
                defaults: new { Controller = "HealthCheck" }
                );

            var assemblyResolver = new AssembliesResolver();

            httpConfiguration.Services.Replace(typeof(IAssembliesResolver), assemblyResolver);

            httpConfiguration.DependencyResolver = new DependencyResolver(configuration, checkers);

            return(app.UseWebApi(httpConfiguration));
        }
Пример #13
0
        public HealthNetModule(IHealthNetConfiguration configuration, IEnumerable<ISystemChecker> systemCheckers)
            : base(configuration.Path)
        {
            Get[""] = p =>
            {
                var healthChecker = new HealthCheckService(configuration, new VersionProvider(configuration), systemCheckers);

                var intrusive = false;
                if (Request.Query.intrusive != null)
                {
                    intrusive = Request.Query.intrusive == "true";
                }

                Action<Stream> performeHealthCheck = stream => new HealthResultJsonSerializer().SerializeToStream(stream, healthChecker.CheckHealth(intrusive));

                return new Response { Contents = performeHealthCheck, ContentType = Constants.Response.ContentType.Json + "; charset=utf-8", StatusCode = HttpStatusCode.OK };
            };
        }
Пример #14
0
        public HealthNetModule(IHealthNetConfiguration configuration, IEnumerable <ISystemChecker> systemCheckers)
            : base(configuration.Path)
        {
            Get[""] = p =>
            {
                var healthChecker = new HealthCheckService(configuration, new VersionProvider(configuration), systemCheckers);

                var intrusive = false;
                if (Request.Query.intrusive != null)
                {
                    intrusive = Request.Query.intrusive == "true";
                }

                Action <Stream> performeHealthCheck = stream => new HealthResultJsonSerializer().SerializeToStream(stream, healthChecker.CheckHealth(intrusive));

                return(new Response {
                    Contents = performeHealthCheck, ContentType = Constants.Response.ContentType.Json + "; charset=utf-8", StatusCode = HttpStatusCode.OK
                });
            };
        }
Пример #15
0
 public HealthNetMiddleware(RequestDelegate next, IHealthNetConfiguration configuration)
 {
     this.next          = next;
     this.configuration = configuration;
     serializer         = new HealthResultJsonSerializer();
 }
Пример #16
0
 public HealthCheckService(IHealthNetConfiguration healthNetConfiguration, IVersionProvider versionProvider, IEnumerable<ISystemChecker> systemStateCheckers)
 {
     this.healthNetConfiguration = healthNetConfiguration;
     this.versionProvider = versionProvider;
     this.systemStateCheckers = systemStateCheckers;
 }
Пример #17
0
 public HealthCheckController(IHealthNetConfiguration configuration, IEnumerable <ISystemChecker> checkers)
 {
     this.configuration = configuration;
     this.checkers      = checkers;
 }
Пример #18
0
 public DependencyResolver(IHealthNetConfiguration configuration, IEnumerable<ISystemChecker> checkers)
 {
     this.configuration = configuration;
     this.checkers = checkers;
 }
Пример #19
0
 public VersionProvider(IHealthNetConfiguration healthNetConfiguration)
 {
     this.healthNetConfiguration = healthNetConfiguration;
 }
Пример #20
0
 public HealthNetMiddleware(AppFunc next, IHealthNetConfiguration configuration, Func<IEnumerable<ISystemChecker>> systemCheckerResolverFactory)
 {
     this.next = next;
     this.configuration = configuration;
     this.systemCheckerResolverFactory = systemCheckerResolverFactory;
 }
 public AssemblyFileVersionProvider(IHealthNetConfiguration healthNetConfiguration)
 {
     this.healthNetConfiguration = healthNetConfiguration;
 }
Пример #22
0
 public HealthNetModule(
     IHealthNetConfiguration configuration,
     IEnumerable <ISystemChecker> systemCheckers)
     : this(configuration, new AssemblyFileVersionProvider(configuration), systemCheckers)
 {
 }
Пример #23
0
        public static IAppBuilder UseHealthNet(this IAppBuilder appBuilder, IHealthNetConfiguration configuration, Func<IEnumerable<ISystemChecker>> systemCheckerResolver)
        {
            appBuilder.Use(typeof(HealthNetMiddleware), configuration, systemCheckerResolver);

            return appBuilder;
        }
Пример #24
0
 public HealthCheckController(
     IHealthNetConfiguration configuration,
     IEnumerable <ISystemChecker> checkers)
     : this(configuration, new AssemblyFileVersionProvider(configuration), checkers)
 {
 }
Пример #25
0
 public VersionProvider(IHealthNetConfiguration healthNetConfiguration)
 {
     this.healthNetConfiguration = healthNetConfiguration;
 }
Пример #26
0
 public HealthCheckController(IHealthNetConfiguration configuration, IEnumerable<ISystemChecker> checkers)
 {
     this.configuration = configuration;
     this.checkers = checkers;
 }