-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding features #219
Adding features #219
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
#pragma warning disable CS0661 // Type defines operator == or operator != but does not override Object.GetHashCode() | ||
namespace Consul.Filtering | ||
{ | ||
public sealed class ServiceSelector : Selector | ||
public sealed class ServiceSelector : Selector, IEqualsApplicableConstraint | ||
{ | ||
private static readonly string Self = "Service"; | ||
|
||
|
@@ -29,6 +29,9 @@ public sealed class ServiceSelector : Selector | |
public MetaSelector Meta { get; } = new MetaSelector(Self); | ||
|
||
public override string Encode() => Self; | ||
|
||
public static Filter operator ==(ServiceSelector selector, string value) => Filters.Eq(selector, value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think a "service" is a valid selector that can be used for anything. Also, this is not being used in an actual test (apart from encoding tests). I think that it should be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I see. It would be great though if you implement at least one test case which uses this APIs. |
||
public static Filter operator !=(ServiceSelector selector, string value) => Filters.NotEq(selector, value); | ||
} | ||
} | ||
#pragma warning restore CS0661 // Type defines operator == or operator != but does not override Object.GetHashCode() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ public interface IAgentEndpoint | |
Task<WriteResult> CheckDeregister(string checkID, CancellationToken ct = default(CancellationToken)); | ||
Task<WriteResult> CheckRegister(AgentCheckRegistration check, CancellationToken ct = default(CancellationToken)); | ||
Task<QueryResult<Dictionary<string, AgentCheck>>> Checks(CancellationToken ct = default(CancellationToken)); | ||
Task<QueryResult<Dictionary<string, AgentCheck>>> Checks(Filter filter, CancellationToken ct = default(CancellationToken)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
Task<WriteResult> DisableNodeMaintenance(CancellationToken ct = default(CancellationToken)); | ||
Task<WriteResult> DisableServiceMaintenance(string serviceID, CancellationToken ct = default(CancellationToken)); | ||
Task<WriteResult> EnableNodeMaintenance(string reason, CancellationToken ct = default(CancellationToken)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍