Skip to content

Commit

Permalink
code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray committed Apr 14, 2023
1 parent 96a3fd8 commit 4afdea3
Show file tree
Hide file tree
Showing 144 changed files with 428 additions and 223 deletions.
3 changes: 2 additions & 1 deletion samples/OcelotBasic/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.IO;

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration;

using Ocelot.DependencyInjection;
using Ocelot.Middleware;

Expand Down
1 change: 1 addition & 0 deletions samples/OcelotOpenTracing/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
using Ocelot.Tracing.OpenTracing;

using OpenTracing.Util;

internal static class Program
Expand Down
3 changes: 2 additions & 1 deletion src/Ocelot.Provider.Eureka/Eureka.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
using System.Threading.Tasks;

using ServiceDiscovery.Providers;
using Values;

using Steeltoe.Discovery;

using Values;

public class Eureka : IServiceDiscoveryProvider
{
Expand Down
1 change: 1 addition & 0 deletions src/Ocelot.Provider.Eureka/OcelotBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using DependencyInjection;

using Microsoft.Extensions.DependencyInjection;

using Steeltoe.Discovery.Client;

public static class OcelotBuilderExtensions
Expand Down
3 changes: 2 additions & 1 deletion src/Ocelot.Provider.Polly/PollyQoSProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ namespace Ocelot.Provider.Polly
using System;
using System.Net.Http;

using Configuration;

using global::Polly;
using global::Polly.CircuitBreaker;
using global::Polly.Timeout;

using Configuration;
using Logging;

public class PollyQoSProvider
Expand Down
5 changes: 3 additions & 2 deletions src/Ocelot.Tracing.OpenTracing/OcelotBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
namespace Ocelot.Tracing.OpenTracing
{
using Microsoft.Extensions.DependencyInjection.Extensions;

using DependencyInjection;

using Logging;

using Microsoft.Extensions.DependencyInjection.Extensions;

public static class OcelotBuilderExtensions
{
public static IOcelotBuilder AddOpenTracing(this IOcelotBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
{
using System.Threading.Tasks;

using Configuration;

using Logging;

using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;

using Configuration;
using Logging;
using Ocelot.Middleware;

public class AuthenticationMiddleware : OcelotMiddleware
Expand Down
2 changes: 2 additions & 0 deletions src/Ocelot/Authorization/ClaimsAuthorizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
using System.Text.RegularExpressions;

using DownstreamRouteFinder.UrlMatcher;

using Ocelot.Infrastructure.Claims.Parser;

using Responses;

public class ClaimsAuthorizer : IClaimsAuthorizer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
{
using System.Threading.Tasks;

using Microsoft.AspNetCore.Http;

using Configuration;

using Logging;

using Microsoft.AspNetCore.Http;

using Ocelot.Middleware;

using Responses;

public class AuthorizationMiddleware : OcelotMiddleware
Expand Down
3 changes: 2 additions & 1 deletion src/Ocelot/Cache/Middleware/OutputCacheMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
using System.Net.Http;
using System.Threading.Tasks;

using Logging;

using Microsoft.AspNetCore.Http;

using Logging;
using Ocelot.Middleware;

public class OutputCacheMiddleware : OcelotMiddleware
Expand Down
3 changes: 2 additions & 1 deletion src/Ocelot/Claims/Middleware/ClaimsToClaimsMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using System.Linq;
using System.Threading.Tasks;

using Logging;

using Microsoft.AspNetCore.Http;

using Logging;
using Ocelot.Middleware;

public class ClaimsToClaimsMiddleware : OcelotMiddleware
Expand Down
3 changes: 2 additions & 1 deletion src/Ocelot/Configuration/Builder/RouteBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
using System.Linq;
using System.Net.Http;

using File;
using File;

using Values;

public class RouteBuilder
Expand Down
4 changes: 2 additions & 2 deletions src/Ocelot/Configuration/Creator/HttpHandlerOptionsCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{
using System;

using File;

using Logging;

using Microsoft.Extensions.DependencyInjection;

using File;

public class HttpHandlerOptionsCreator : IHttpHandlerOptionsCreator
{
private readonly ITracer _tracer;
Expand Down
1 change: 1 addition & 0 deletions src/Ocelot/Configuration/Creator/QoSOptionsCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace Ocelot.Configuration.Creator
using System.Linq;

using Builder;

using File;

public class QoSOptionsCreator : IQoSOptionsCreator
Expand Down
3 changes: 2 additions & 1 deletion src/Ocelot/Configuration/Creator/RouteOptionsCreator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Ocelot.Configuration.Creator
{
using Builder;
using Builder;

using File;

public class RouteOptionsCreator : IRouteOptionsCreator
Expand Down
4 changes: 3 additions & 1 deletion src/Ocelot/Configuration/Creator/RoutesCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ namespace Ocelot.Configuration.Creator
using System.Collections.Generic;
using System.Linq;

using Cache;
using Builder;

using Cache;

using File;

public class RoutesCreator : IRoutesCreator
Expand Down
3 changes: 2 additions & 1 deletion src/Ocelot/Configuration/DownstreamRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ namespace Ocelot.Configuration
using System;
using System.Collections.Generic;

using Creator;
using Creator;

using Values;

public class DownstreamRoute
Expand Down
1 change: 1 addition & 0 deletions src/Ocelot/Configuration/Route.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Net.Http;

using File;

using Values;

public class Route
Expand Down
2 changes: 1 addition & 1 deletion src/Ocelot/Configuration/ServiceProviderConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class ServiceProviderConfiguration
{
public ServiceProviderConfiguration(string type, string scheme, string host, int port, string token, string configurationKey, int pollingInterval, string @namespace ="")
public ServiceProviderConfiguration(string type, string scheme, string host, int port, string token, string configurationKey, int pollingInterval, string @namespace = "")
{
ConfigurationKey = configurationKey;
Scheme = scheme;
Expand Down
4 changes: 2 additions & 2 deletions src/Ocelot/Configuration/Validator/HostAndPortValidator.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Ocelot.Configuration.Validator
{
using FluentValidation;

using File;

using FluentValidation;

public class HostAndPortValidator : AbstractValidator<FileHostAndPort>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{
using System.Threading.Tasks;

using File;
using File;

using Responses;

public interface IConfigurationValidator
Expand Down
4 changes: 2 additions & 2 deletions src/Ocelot/Configuration/Validator/RouteFluentValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
using System.Threading;
using System.Threading.Tasks;

using File;

using FluentValidation;

using Microsoft.AspNetCore.Authentication;

using File;

public class RouteFluentValidator : AbstractValidator<FileRoute>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ namespace Ocelot.DependencyInjection
using System.Linq;
using System.Text.RegularExpressions;

using Configuration.File;

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Memory;

using Newtonsoft.Json;

using Configuration.File;

public static class ConfigurationBuilderExtensions
{
Expand Down
34 changes: 27 additions & 7 deletions src/Ocelot/DependencyInjection/OcelotBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ namespace Ocelot.DependencyInjection
using System.Net.Http;
using System.Reflection;

using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;

using Authorization;

using Cache;

using Claims;

using Configuration;
using Configuration.ChangeTracking;
using Configuration.Creator;
Expand All @@ -22,27 +19,50 @@ namespace Ocelot.DependencyInjection
using Configuration.Repository;
using Configuration.Setter;
using Configuration.Validator;

using DownstreamRouteFinder.Finder;
using DownstreamRouteFinder.UrlMatcher;

using DownstreamUrlCreator.UrlTemplateReplacer;

using Headers;

using Infrastructure;
using Ocelot.Infrastructure.Claims.Parser;
using Infrastructure.RequestData;

using LoadBalancer.LoadBalancers;

using Logging;

using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;

using Middleware;

using Multiplexer;

using Ocelot.Infrastructure.Claims.Parser;

using PathManipulation;

using QueryStrings;

using RateLimit;

using Request.Creator;
using Request.Mapper;

using Requester;
using Requester.QoS;

using Responder;

using Security;
using Security.IPSecurity;

using ServiceDiscovery;
using ServiceDiscovery.Providers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
using System.Linq;
using System.Threading.Tasks;

using Logging;

using Microsoft.AspNetCore.Http;

using Logging;
using Ocelot.Middleware;

using PathManipulation;

public class ClaimsToDownstreamPathMiddleware : OcelotMiddleware
Expand Down
1 change: 1 addition & 0 deletions src/Ocelot/DownstreamRouteFinder/DownstreamRouteHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;

using Configuration;

using UrlMatcher;

public class DownstreamRouteHolder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
using Configuration;
using Configuration.Builder;
using Configuration.Creator;
using UrlMatcher;

using LoadBalancer.LoadBalancers;

using Responses;

using UrlMatcher;

public class DownstreamRouteCreator : IDownstreamRouteProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

using Configuration;

using Microsoft.Extensions.DependencyInjection;

using Logging;

using Microsoft.Extensions.DependencyInjection;

public class DownstreamRouteProviderFactory : IDownstreamRouteProviderFactory
{
Expand Down
Loading

0 comments on commit 4afdea3

Please sign in to comment.