Ejemplo n.º 1
0
 private void ConfigureHelpers(IServiceCollection services)
 {
     HelpersManager.Configure(_correlationId, services, Configuration);
     CommonPatterns.Filters.ExceptionFilter.Configure(services);
     CommonPatterns.Filters.RequestResponseFilter.Configure(services);
     SwaggerHelper.Configure(services);
     CacheHelper.Configure(services);
     HealthCheckHelper.Configure(services);
     BeatPulseHelper.Configure(services, Configuration);
     WhoIsHelper.Configure(services);
 }
Ejemplo n.º 2
0
 private void HelperInjections(IServiceCollection services)
 {
     HelpersManager.Configure(_correlationId, services, Configuration);
     ExceptionFilter.Configure(services);
     RequestResponseFilter.Configure(services);
     RefreshRobotCacheFilter.Configure(services);
     RefreshCyborgCacheFilter.Configure(services);
     SwaggerHelper.Configure(services);
     CacheHelper.Configure(services);
     HealthCheckHelper.Configure(services);
     BeatPulseHelper.Configure(services, Configuration);
     WhoIsHelper.Configure(services);
 }
Ejemplo n.º 3
0
        private string Search(string domain)
        {
            // assume input domain is google.com
            string topLevelDomain = WhoIsHelper.GetTopLevelDomain(domain); // topLevelDomain is com.

            string response = string.Empty;

            if (string.IsNullOrEmpty(topLevelDomain.Trim()))
            {
                //this.Search(domain);
            }
            else
            {
                response = Query(topLevelDomain, "whois.iana.org").ToLower();
                string whoisServer  = string.Empty;
                string errorMessage = string.Empty;

                if (!WhoIsHelper.ParseIanaResponseForTldWhoisServer(topLevelDomain, response, out whoisServer, out errorMessage))
                {
                    Console.WriteLine("Invalid Whois Server: {0}", topLevelDomain);
                }
                else
                {
                    response = Query(domain, whoisServer).ToLower();
                    if (WhoIsHelper.IsDomainAvailable(domain, response))
                    {
                        Console.WriteLine("server '{0}' is available.", whoisServer);
                    }
                    else
                    {
                        Console.WriteLine("server '{0}' is not available.", whoisServer);
                    }
                }
            }

            return(response);
        }