mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-20 07:22:50 +08:00
Fix file names to match class names
SA1649
This commit is contained in:
parent
c7dbfc044f
commit
a64e263a26
@ -1,14 +1,14 @@
|
||||
namespace Ocelot.Configuration
|
||||
{
|
||||
public class ServiceProviderConfiguration
|
||||
{
|
||||
public ServiceProviderConfiguration(string serviceProviderHost, int serviceProviderPort)
|
||||
{
|
||||
ServiceProviderHost = serviceProviderHost;
|
||||
ServiceProviderPort = serviceProviderPort;
|
||||
}
|
||||
|
||||
public string ServiceProviderHost { get; private set; }
|
||||
public int ServiceProviderPort { get; private set; }
|
||||
}
|
||||
namespace Ocelot.Configuration
|
||||
{
|
||||
public class ServiceProviderConfiguration
|
||||
{
|
||||
public ServiceProviderConfiguration(string serviceProviderHost, int serviceProviderPort)
|
||||
{
|
||||
ServiceProviderHost = serviceProviderHost;
|
||||
ServiceProviderPort = serviceProviderPort;
|
||||
}
|
||||
|
||||
public string ServiceProviderHost { get; private set; }
|
||||
public int ServiceProviderPort { get; private set; }
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.Responses;
|
||||
|
||||
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
|
||||
{
|
||||
public interface IPlaceholderNameAndValueFinder
|
||||
{
|
||||
Response<List<PlaceholderNameAndValue>> Find(string path, string pathTemplate);
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.Responses;
|
||||
|
||||
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
|
||||
{
|
||||
public interface IPlaceholderNameAndValueFinder
|
||||
{
|
||||
Response<List<PlaceholderNameAndValue>> Find(string path, string pathTemplate);
|
||||
}
|
||||
}
|
@ -1,14 +1,14 @@
|
||||
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
|
||||
{
|
||||
public class PlaceholderNameAndValue
|
||||
{
|
||||
public PlaceholderNameAndValue(string name, string value)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public string Name {get;private set;}
|
||||
public string Value {get;private set;}
|
||||
}
|
||||
}
|
||||
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
|
||||
{
|
||||
public class PlaceholderNameAndValue
|
||||
{
|
||||
public PlaceholderNameAndValue(string name, string value)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public string Name {get;private set;}
|
||||
public string Value {get;private set;}
|
||||
}
|
||||
}
|
@ -1,25 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Ocelot.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Responses;
|
||||
using Ocelot.Values;
|
||||
|
||||
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
|
||||
{
|
||||
public class DownstreamTemplatePathPlaceholderReplacer : IDownstreamPathPlaceholderReplacer
|
||||
{
|
||||
public Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues)
|
||||
{
|
||||
var downstreamPath = new StringBuilder();
|
||||
|
||||
downstreamPath.Append(downstreamPathTemplate.Value);
|
||||
|
||||
foreach (var placeholderVariableAndValue in urlPathPlaceholderNameAndValues)
|
||||
{
|
||||
downstreamPath.Replace(placeholderVariableAndValue.Name, placeholderVariableAndValue.Value);
|
||||
}
|
||||
|
||||
return new OkResponse<DownstreamPath>(new DownstreamPath(downstreamPath.ToString()));
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Ocelot.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Responses;
|
||||
using Ocelot.Values;
|
||||
|
||||
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
|
||||
{
|
||||
public class DownstreamTemplatePathPlaceholderReplacer : IDownstreamPathPlaceholderReplacer
|
||||
{
|
||||
public Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues)
|
||||
{
|
||||
var downstreamPath = new StringBuilder();
|
||||
|
||||
downstreamPath.Append(downstreamPathTemplate.Value);
|
||||
|
||||
foreach (var placeholderVariableAndValue in urlPathPlaceholderNameAndValues)
|
||||
{
|
||||
downstreamPath.Replace(placeholderVariableAndValue.Name, placeholderVariableAndValue.Value);
|
||||
}
|
||||
|
||||
return new OkResponse<DownstreamPath>(new DownstreamPath(downstreamPath.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Responses;
|
||||
using Ocelot.Values;
|
||||
|
||||
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
|
||||
{
|
||||
public interface IDownstreamPathPlaceholderReplacer
|
||||
{
|
||||
Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues);
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Responses;
|
||||
using Ocelot.Values;
|
||||
|
||||
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
|
||||
{
|
||||
public interface IDownstreamPathPlaceholderReplacer
|
||||
{
|
||||
Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues);
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
|
||||
namespace Ocelot.Raft
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property)]
|
||||
public class ExcludeFromCoverageAttribute : Attribute{}
|
||||
using System;
|
||||
|
||||
namespace Ocelot.Raft
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property)]
|
||||
public class ExcludeFromCoverageAttribute : Attribute{}
|
||||
}
|
6
src/Ocelot/Requester/ITracingHandler.cs
Normal file
6
src/Ocelot/Requester/ITracingHandler.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Ocelot.Requester
|
||||
{
|
||||
public interface ITracingHandler
|
||||
{
|
||||
}
|
||||
}
|
@ -8,10 +8,6 @@ using Butterfly.OpenTracing;
|
||||
|
||||
namespace Ocelot.Requester
|
||||
{
|
||||
public interface ITracingHandler
|
||||
{
|
||||
}
|
||||
|
||||
public class OcelotHttpTracingHandler : DelegatingHandler, ITracingHandler
|
||||
{
|
||||
private readonly IServiceTracer _tracer;
|
||||
|
@ -3,7 +3,9 @@ using Ocelot.Errors;
|
||||
|
||||
namespace Ocelot.Responses
|
||||
{
|
||||
#pragma warning disable SA1649 // File name must match first type name
|
||||
public class ErrorResponse<T> : Response<T>
|
||||
#pragma warning restore SA1649 // File name must match first type name
|
||||
{
|
||||
public ErrorResponse(Error error)
|
||||
: base(new List<Error> {error})
|
||||
|
@ -1,9 +1,11 @@
|
||||
namespace Ocelot.Responses
|
||||
{
|
||||
#pragma warning disable SA1649 // File name must match first type name
|
||||
public class OkResponse<T> : Response<T>
|
||||
#pragma warning restore SA1649 // File name must match first type name
|
||||
{
|
||||
public OkResponse(T data) : base(data)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ using Ocelot.Errors;
|
||||
|
||||
namespace Ocelot.Responses
|
||||
{
|
||||
#pragma warning disable SA1649 // File name must match first type name
|
||||
public abstract class Response<T> : Response
|
||||
#pragma warning restore SA1649 // File name must match first type name
|
||||
{
|
||||
protected Response(T data)
|
||||
{
|
||||
|
10
test/Ocelot.UnitTests/Wait.cs
Normal file
10
test/Ocelot.UnitTests/Wait.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace Ocelot.UnitTests
|
||||
{
|
||||
public class Wait
|
||||
{
|
||||
public static Waiter WaitFor(int milliSeconds)
|
||||
{
|
||||
return new Waiter(milliSeconds);
|
||||
}
|
||||
}
|
||||
}
|
@ -3,14 +3,6 @@ using System.Diagnostics;
|
||||
|
||||
namespace Ocelot.UnitTests
|
||||
{
|
||||
public class Wait
|
||||
{
|
||||
public static Waiter WaitFor(int milliSeconds)
|
||||
{
|
||||
return new Waiter(milliSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
public class Waiter
|
||||
{
|
||||
private readonly int _milliSeconds;
|
||||
@ -52,4 +44,4 @@ namespace Ocelot.UnitTests
|
||||
return passed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user