-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TTL Enhancements, PeerURI bugfixes, and dep update
* New: `WithTimeToLive` extension methods which support taking * a`TimeSpan?` * Fixed: `IClusterEtcdClient.CreateMember()` call will now normalize the * passed `WithPeerUri` values in order to conform with etcd's expected * input format (just scheme://address:port/) * Fixed: `IClusterEtcdClient.UpdateMemberPeerUrls()` call will now * normalize the passed `WithPeerUri` values in order to conform with * etcd's expected input format (just scheme://address:port/) * Change: Updated Flurl dependency from 1.0.8 to 1.0.10 * Change: Updated Flurl.Http dependency from 0.6.2 to 0.7.0
- Loading branch information
1 parent
63f504c
commit 48a7a08
Showing
18 changed files
with
207 additions
and
66 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
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,70 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
using Draft.Requests; | ||
|
||
namespace Draft | ||
{ | ||
/// <summary> | ||
/// Additional TimeToLive extensions methods for request operations | ||
/// </summary> | ||
public static class TimeToLiveExtensions | ||
{ | ||
|
||
private static T ApplyTimeToLive<T>(this T This, TimeSpan? timeSpan, Func<T, long, T> func) | ||
{ | ||
return timeSpan.HasValue | ||
? func(This, Convert.ToInt64(timeSpan.Value.TotalSeconds)) | ||
: This; | ||
} | ||
|
||
/// <summary> | ||
/// An optional expiration for this key. | ||
/// </summary> | ||
public static ICompareAndSwapByIndexRequest WithTimeToLive(this ICompareAndSwapByIndexRequest This, TimeSpan? timeSpan) | ||
{ | ||
return This.ApplyTimeToLive(timeSpan, (x, y) => x.WithTimeToLive(y)); | ||
} | ||
|
||
/// <summary> | ||
/// An optional expiration for this key. | ||
/// </summary> | ||
public static ICompareAndSwapByValueRequest WithTimeToLive(this ICompareAndSwapByValueRequest This, TimeSpan? timeSpan) | ||
{ | ||
return This.ApplyTimeToLive(timeSpan, (x, y) => x.WithTimeToLive(y)); | ||
} | ||
|
||
/// <summary> | ||
/// An optional expiration for this key. | ||
/// </summary> | ||
public static ICreateDirectoryRequest WithTimeToLive(this ICreateDirectoryRequest This, TimeSpan? timeSpan) | ||
{ | ||
return This.ApplyTimeToLive(timeSpan, (x, y) => x.WithTimeToLive(y)); | ||
} | ||
|
||
/// <summary> | ||
/// An optional expiration for this key. | ||
/// </summary> | ||
public static IQueueRequest WithTimeToLive(this IQueueRequest This, TimeSpan? timeSpan) | ||
{ | ||
return This.ApplyTimeToLive(timeSpan, (x, y) => x.WithTimeToLive(y)); | ||
} | ||
|
||
/// <summary> | ||
/// An optional expiration for this key. | ||
/// </summary> | ||
public static IUpdateDirectoryRequest WithTimeToLive(this IUpdateDirectoryRequest This, TimeSpan? timeSpan) | ||
{ | ||
return This.ApplyTimeToLive(timeSpan, (x, y) => x.WithTimeToLive(y)); | ||
} | ||
|
||
/// <summary> | ||
/// An optional expiration for this key. | ||
/// </summary> | ||
public static IUpsertKeyRequest WithTimeToLive(this IUpsertKeyRequest This, TimeSpan? timeSpan) | ||
{ | ||
return This.ApplyTimeToLive(timeSpan, (x, y) => x.WithTimeToLive(y)); | ||
} | ||
|
||
} | ||
} |
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
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
Oops, something went wrong.