-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Service Discovery API refactoring (#3114)
* API review feedback & general cleanup including removal of currently unused features * Align namespaces * Hide more of the API, rename for consistency * Hide more, rename more * ResolutionStatus does not need to be equatable * Make ServiceEndPointQuery public to break InternalsVisibleTo with Dns provider * Break InternalsVisibleTo from ServiceDiscovery package to YARP by adding a middleware factory * Remove ResolutionStatus, simplifying Service Discovery interfaces * Clean up ServiceEndPointImpl * Mark ServiceEndPointResolverResult as internal * Remove unnecessary members from ServiceEndPointCollection/Source * Seal service discovery types * Remove IServiceEndPointSelectorFactory and use DI instead * Remove unused endpoint selectors * Remove unused PendingStatusRefreshPeriod option * Rename UseServiceDiscovery to AddServiceDiscovery * Remove possible ambiguity in AddConfigurationServiceEndPointResolver signature * Add configuration delegate overloads to AddServiceDiscovery methods * Clean up logging in configuration-based service endpoint provider * API review: rename ServiceEndPointCollectionSource to IServiceEndPointBuilder * Rename IServiceDiscoveryDelegatingHttpMessageHandlerFactory * Rename IServiceEndPointProvider.ResolveAsync to PopulateAsync * Hide IServiceEndPointSelector * Remove allowedSchemes from ServiceEndPointQuery.TryParse * Rename ServiceEndPointQuery.Host to .ServiceName * Fix build * Review feedback * nit param rename * Improve ServiceEndPointQuery.ToString output * fixup
- Loading branch information
1 parent
ac2b068
commit 23104ee
Showing
74 changed files
with
695 additions
and
1,291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/Features/IEndPointHealthFeature.cs
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/Features/IEndPointLoadFeature.cs
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...Abstractions/Features/IHostNameFeature.cs → ...iscovery.Abstractions/IHostNameFeature.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/IServiceEndPointBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.AspNetCore.Http.Features; | ||
using Microsoft.Extensions.Primitives; | ||
|
||
namespace Microsoft.Extensions.ServiceDiscovery; | ||
|
||
/// <summary> | ||
/// Builder to create a <see cref="ServiceEndPointSource"/> instances. | ||
/// </summary> | ||
public interface IServiceEndPointBuilder | ||
{ | ||
/// <summary> | ||
/// Gets the endpoints. | ||
/// </summary> | ||
IList<ServiceEndPoint> EndPoints { get; } | ||
|
||
/// <summary> | ||
/// Gets the feature collection. | ||
/// </summary> | ||
IFeatureCollection Features { get; } | ||
|
||
/// <summary> | ||
/// Adds a change token to the resulting <see cref="ServiceEndPointSource"/>. | ||
/// </summary> | ||
/// <param name="changeToken">The change token.</param> | ||
void AddChangeToken(IChangeToken changeToken); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/IServiceEndPointSelectorProvider.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 0 additions & 101 deletions
101
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/ResolutionStatus.cs
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
src/Microsoft.Extensions.ServiceDiscovery.Abstractions/ResolutionStatusCode.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.