-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* optimized test fixtures. * reverted spaces to tabs...
- Loading branch information
1 parent
e39d52d
commit 67e9132
Showing
258 changed files
with
14,635 additions
and
13,369 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
20 changes: 11 additions & 9 deletions
20
src/EventStore.Client.Common/AsyncStreamReaderExtensions.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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
using System.Runtime.CompilerServices; | ||
using Grpc.Core; | ||
|
||
namespace EventStore.Client { | ||
internal static class AsyncStreamReaderExtensions { | ||
public static async IAsyncEnumerable<T> ReadAllAsync<T>(this IAsyncStreamReader<T> reader, | ||
[EnumeratorCancellation] CancellationToken cancellationToken = default) { | ||
while (await reader.MoveNext(cancellationToken).ConfigureAwait(false)) { | ||
yield return reader.Current; | ||
} | ||
} | ||
namespace EventStore.Client; | ||
|
||
static class AsyncStreamReaderExtensions { | ||
public static async IAsyncEnumerable<T> ReadAllAsync<T>( | ||
this IAsyncStreamReader<T> reader, | ||
[EnumeratorCancellation] | ||
CancellationToken cancellationToken = default | ||
) { | ||
while (await reader.MoveNext(cancellationToken).ConfigureAwait(false)) | ||
yield return reader.Current; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,61 +1,61 @@ | ||
namespace EventStore.Client; | ||
|
||
internal static class Constants { | ||
public static class Exceptions { | ||
public const string ExceptionKey = "exception"; | ||
|
||
public const string AccessDenied = "access-denied"; | ||
public const string InvalidTransaction = "invalid-transaction"; | ||
public const string StreamDeleted = "stream-deleted"; | ||
public const string WrongExpectedVersion = "wrong-expected-version"; | ||
public const string StreamNotFound = "stream-not-found"; | ||
public const string MaximumAppendSizeExceeded = "maximum-append-size-exceeded"; | ||
public const string MissingRequiredMetadataProperty = "missing-required-metadata-property"; | ||
public const string NotLeader = "not-leader"; | ||
|
||
public const string PersistentSubscriptionFailed = "persistent-subscription-failed"; | ||
public const string PersistentSubscriptionDoesNotExist = "persistent-subscription-does-not-exist"; | ||
public const string PersistentSubscriptionExists = "persistent-subscription-exists"; | ||
public const string MaximumSubscribersReached = "maximum-subscribers-reached"; | ||
public const string PersistentSubscriptionDropped = "persistent-subscription-dropped"; | ||
|
||
public const string UserNotFound = "user-not-found"; | ||
public const string UserConflict = "user-conflict"; | ||
|
||
public const string ScavengeNotFound = "scavenge-not-found"; | ||
|
||
public const string ExpectedVersion = "expected-version"; | ||
public const string ActualVersion = "actual-version"; | ||
public const string StreamName = "stream-name"; | ||
public const string GroupName = "group-name"; | ||
public const string Reason = "reason"; | ||
public const string MaximumAppendSize = "maximum-append-size"; | ||
public const string RequiredMetadataProperties = "required-metadata-properties"; | ||
public const string ScavengeId = "scavenge-id"; | ||
public const string LeaderEndpointHost = "leader-endpoint-host"; | ||
public const string LeaderEndpointPort = "leader-endpoint-port"; | ||
|
||
public const string LoginName = "login-name"; | ||
} | ||
|
||
public static class Metadata { | ||
public const string Type = "type"; | ||
public const string Created = "created"; | ||
public const string ContentType = "content-type"; | ||
public static readonly string[] RequiredMetadata = {Type, ContentType}; | ||
|
||
public static class ContentTypes { | ||
public const string ApplicationJson = "application/json"; | ||
public const string ApplicationOctetStream = "application/octet-stream"; | ||
} | ||
} | ||
|
||
public static class Headers { | ||
public const string Authorization = "authorization"; | ||
public const string BasicScheme = "Basic"; | ||
public const string BearerScheme = "Bearer"; | ||
|
||
public const string ConnectionName = "connection-name"; | ||
public const string RequiresLeader = "requires-leader"; | ||
} | ||
namespace EventStore.Client; | ||
|
||
static class Constants { | ||
public static class Exceptions { | ||
public const string ExceptionKey = "exception"; | ||
|
||
public const string AccessDenied = "access-denied"; | ||
public const string InvalidTransaction = "invalid-transaction"; | ||
public const string StreamDeleted = "stream-deleted"; | ||
public const string WrongExpectedVersion = "wrong-expected-version"; | ||
public const string StreamNotFound = "stream-not-found"; | ||
public const string MaximumAppendSizeExceeded = "maximum-append-size-exceeded"; | ||
public const string MissingRequiredMetadataProperty = "missing-required-metadata-property"; | ||
public const string NotLeader = "not-leader"; | ||
|
||
public const string PersistentSubscriptionFailed = "persistent-subscription-failed"; | ||
public const string PersistentSubscriptionDoesNotExist = "persistent-subscription-does-not-exist"; | ||
public const string PersistentSubscriptionExists = "persistent-subscription-exists"; | ||
public const string MaximumSubscribersReached = "maximum-subscribers-reached"; | ||
public const string PersistentSubscriptionDropped = "persistent-subscription-dropped"; | ||
|
||
public const string UserNotFound = "user-not-found"; | ||
public const string UserConflict = "user-conflict"; | ||
|
||
public const string ScavengeNotFound = "scavenge-not-found"; | ||
|
||
public const string ExpectedVersion = "expected-version"; | ||
public const string ActualVersion = "actual-version"; | ||
public const string StreamName = "stream-name"; | ||
public const string GroupName = "group-name"; | ||
public const string Reason = "reason"; | ||
public const string MaximumAppendSize = "maximum-append-size"; | ||
public const string RequiredMetadataProperties = "required-metadata-properties"; | ||
public const string ScavengeId = "scavenge-id"; | ||
public const string LeaderEndpointHost = "leader-endpoint-host"; | ||
public const string LeaderEndpointPort = "leader-endpoint-port"; | ||
|
||
public const string LoginName = "login-name"; | ||
} | ||
|
||
public static class Metadata { | ||
public const string Type = "type"; | ||
public const string Created = "created"; | ||
public const string ContentType = "content-type"; | ||
public static readonly string[] RequiredMetadata = { Type, ContentType }; | ||
|
||
public static class ContentTypes { | ||
public const string ApplicationJson = "application/json"; | ||
public const string ApplicationOctetStream = "application/octet-stream"; | ||
} | ||
} | ||
|
||
public static class Headers { | ||
public const string Authorization = "authorization"; | ||
public const string BasicScheme = "Basic"; | ||
public const string BearerScheme = "Bearer"; | ||
|
||
public const string ConnectionName = "connection-name"; | ||
public const string RequiresLeader = "requires-leader"; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
namespace EventStore.Client { | ||
internal static class EpochExtensions { | ||
private static readonly DateTime UnixEpoch = DateTime.UnixEpoch; | ||
namespace EventStore.Client; | ||
|
||
public static DateTime FromTicksSinceEpoch(this long value) => | ||
new DateTime(UnixEpoch.Ticks + value, DateTimeKind.Utc); | ||
static class EpochExtensions { | ||
static readonly DateTime UnixEpoch = DateTime.UnixEpoch; | ||
|
||
public static long ToTicksSinceEpoch(this DateTime value) => | ||
(value - UnixEpoch).Ticks; | ||
} | ||
} | ||
public static DateTime FromTicksSinceEpoch(this long value) => new(UnixEpoch.Ticks + value, DateTimeKind.Utc); | ||
|
||
public static long ToTicksSinceEpoch(this DateTime value) => (value - UnixEpoch).Ticks; | ||
} |
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.