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