本文整理汇总了C#中EventStore.ClientAPI.SystemData.UserCredentials类的典型用法代码示例。如果您正苦于以下问题:C# UserCredentials类的具体用法?C# UserCredentials怎么用?C# UserCredentials使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserCredentials类属于EventStore.ClientAPI.SystemData命名空间,在下文中一共展示了UserCredentials类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Start
public void Start()
{
if (EmbeddedEventStoreConfiguration.RunWithLogging)
{
if (!Directory.Exists(EmbeddedEventStoreConfiguration.LogPath))
Directory.CreateDirectory(EmbeddedEventStoreConfiguration.LogPath);
LogManager.Init(string.Format("as-embed-es-{0}", DateTime.Now.Ticks), EmbeddedEventStoreConfiguration.LogPath);
}
var db = CreateTFChunkDb(EmbeddedEventStoreConfiguration.StoragePath);
var settings = CreateSingleVNodeSettings();
_node = new SingleVNode(db, settings, false, 0xf4240, new ISubsystem[0]);
var waitHandle = new ManualResetEvent(false);
_node.MainBus.Subscribe(new AdHocHandler<SystemMessage.BecomeMaster>(m => waitHandle.Set()));
_node.Start();
waitHandle.WaitOne();
_credentials = new UserCredentials("admin", "changeit");
_connection = EventStoreConnection.Create(
ConnectionSettings.Create().
EnableVerboseLogging().
SetDefaultUserCredentials(_credentials).
UseConsoleLogger(),
TcpEndPoint);
_connection.Connect();
}
开发者ID:jen20,项目名称:AggregateSource,代码行数:25,代码来源:EmbeddedEventStore.cs
示例2: Given
protected override void Given()
{
var creds = new UserCredentials("admin", "changeit");
DeletedStreamName = Guid.NewGuid().ToString();
LinkedStreamName = Guid.NewGuid().ToString();
using (var conn = TestConnection.Create(_node.TcpEndPoint))
{
conn.ConnectAsync().Wait();
conn.AppendToStreamAsync(DeletedStreamName, ExpectedVersion.Any, creds,
new EventData(Guid.NewGuid(), "testing1", true, Encoding.UTF8.GetBytes("{'foo' : 4}"), new byte[0]))
.Wait();
conn.SetStreamMetadataAsync(DeletedStreamName, ExpectedVersion.Any,
new StreamMetadata(2, null, null, null, null)).Wait();
conn.AppendToStreamAsync(DeletedStreamName, ExpectedVersion.Any, creds,
new EventData(Guid.NewGuid(), "testing2", true, Encoding.UTF8.GetBytes("{'foo' : 4}"), new byte[0]))
.Wait();
conn.AppendToStreamAsync(DeletedStreamName, ExpectedVersion.Any, creds,
new EventData(Guid.NewGuid(), "testing3", true, Encoding.UTF8.GetBytes("{'foo' : 4}"), new byte[0]))
.Wait();
conn.AppendToStreamAsync(LinkedStreamName, ExpectedVersion.Any, creds,
new EventData(Guid.NewGuid(), SystemEventTypes.LinkTo, false,
Encoding.UTF8.GetBytes("[email protected]" + DeletedStreamName), new byte[0])).Wait();
}
}
开发者ID:adbrowne,项目名称:EventStore,代码行数:25,代码来源:SpecificationWithLinkToToMaxCountDeletedEvents.cs
示例3: Given
protected override void Given()
{
UserCredentials = new UserCredentials("dFine", "Password02");
Connection = EventStoreConnection.Create(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1113));
EventFactory = new EventFactory(UserCredentials,
Connection);
}
开发者ID:RokitSalad,项目名称:Helpful.CircuitBreaker.Events.EventStore,代码行数:7,代码来源:using_eventstore_events.cs
示例4: Configure
public static void Configure(ProjectionGatewayConfiguration projectionGatewayConfiguration, IPEndPoint httpEndPoint, UserCredentials credentials)
{
var projectionManager = new ProjectionsManager(new ConsoleLogger(), httpEndPoint, new TimeSpan(1, 0, 0, 0));
var byCategoryProjectionStatus = ((JObject)JsonConvert.DeserializeObject(projectionManager.GetStatusAsync("$by_category", credentials).Result))["status"].ToString();
var streamByCategoryProjectionStatus = ((JObject)JsonConvert.DeserializeObject(projectionManager.GetStatusAsync("$stream_by_category", credentials).Result))["status"].ToString();
if (byCategoryProjectionStatus == "Stopped")
{
projectionManager.EnableAsync("$by_category", credentials).Wait();
}
if (streamByCategoryProjectionStatus == "Stopped")
{
projectionManager.EnableAsync("$stream_by_category", credentials).Wait();
}
const string projectionPattern = @"fromCategory('{0}')
.foreachStream()
.whenAny(function(state, event){{
linkTo('{1}', event);
}})";
foreach (var aggregateRootName in projectionGatewayConfiguration.Subscriptions.Keys)
{
projectionManager.CreateContinuousAsync(
string.Format("{0}Projection", aggregateRootName),
string.Format(projectionPattern, aggregateRootName, aggregateRootName + "View"), credentials).Wait();
}
}
开发者ID:DrunkyBard,项目名称:CqrsMe,代码行数:28,代码来源:EventStoreProjectionConfigurationExtension.cs
示例5: CreateContinuous
public void CreateContinuous(string name, string query, UserCredentials userCredentials = null)
{
Ensure.NotNullOrEmpty(name, "name");
Ensure.NotNullOrEmpty(query, "query");
CreateContinuousAsync(name, query, userCredentials).Wait();
}
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:7,代码来源:ProjectionsManager.cs
示例6: Main
static void Main(string[] args)
{
var endpoint = new IPEndPoint(IPAddress.Loopback, 1113);
var esCon = EventStoreConnection.Create(endpoint);
esCon.Connect();
var credentials = new UserCredentials("admin", "changeit");
var adapter = new EventStoreAdapter(endpoint, credentials);
//var cm = new CommandManager(esCon);
//var pm = new ProjectionManager(endpoint, credentials, adapter);
//pm.Run();
//var cp = new MyDiagProjection(endpoint, credentials, adapter, "Budgets-1722f4ea_a9a5_4d97_8c39_c9d450a1331a");
//cp.Start();
//while (cp.HasLoaded == false)
// System.Threading.Thread.Sleep(100);
//Console.WriteLine("done from all");
//Console.ReadLine();
var cp2 = new BudgetLinesProjection("Budgets-1722f4ea_a9a5_4d97_8c39_c9d450a1331a", endpoint, credentials, adapter, "lines_of_Budgets-1722f4ea_a9a5_4d97_8c39_c9d450a1331a" );
cp2.Start();
//var cp2 = new MyDiagProjection(endpoint, credentials, adapter, "Budgets-1722f4ea_a9a5_4d97_8c39_c9d450a1331a", "lines_of_Budgets-1722f4ea_a9a5_4d97_8c39_c9d450a1331a");
//cp2.Start();
while (cp2.HasLoaded == false)
System.Threading.Thread.Sleep(100);
Console.ReadLine();
//var events = adapter.GetStreamEvents("");
}
开发者ID:valeriob,项目名称:MyBudget,代码行数:35,代码来源:Program.cs
示例7: SubscriptionOperation
public SubscriptionOperation(ILogger log,
TaskCompletionSource<EventStoreSubscription> source,
string streamId,
bool resolveLinkTos,
UserCredentials userCredentials,
Action<EventStoreSubscription, ResolvedEvent> eventAppeared,
Action<EventStoreSubscription, SubscriptionDropReason, Exception> subscriptionDropped,
bool verboseLogging,
Func<TcpPackageConnection> getConnection)
{
Ensure.NotNull(log, "log");
Ensure.NotNull(source, "source");
Ensure.NotNull(eventAppeared, "eventAppeared");
Ensure.NotNull(getConnection, "getConnection");
_log = log;
_source = source;
_streamId = string.IsNullOrEmpty(streamId) ? string.Empty : streamId;
_resolveLinkTos = resolveLinkTos;
_userCredentials = userCredentials;
_eventAppeared = eventAppeared;
_subscriptionDropped = subscriptionDropped ?? ((x, y, z) => { });
_verboseLogging = verboseLogging;
_getConnection = getConnection;
}
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:25,代码来源:SubscriptionOperation.cs
示例8: EventStoreCatchUpSubscription
protected EventStoreCatchUpSubscription(IEventStoreConnection connection,
ILogger log,
string streamId,
bool resolveLinkTos,
UserCredentials userCredentials,
Action<EventStoreCatchUpSubscription, ResolvedEvent> eventAppeared,
Action<EventStoreCatchUpSubscription> liveProcessingStarted,
Action<EventStoreCatchUpSubscription, SubscriptionDropReason, Exception> subscriptionDropped,
bool verboseLogging,
int readBatchSize = DefaultReadBatchSize,
int maxPushQueueSize = DefaultMaxPushQueueSize)
{
Ensure.NotNull(connection, "connection");
Ensure.NotNull(log, "log");
Ensure.NotNull(eventAppeared, "eventAppeared");
Ensure.Positive(readBatchSize, "readBatchSize");
Ensure.Positive(maxPushQueueSize, "maxPushQueueSize");
_connection = connection;
Log = log;
_streamId = string.IsNullOrEmpty(streamId) ? string.Empty : streamId;
_resolveLinkTos = resolveLinkTos;
_userCredentials = userCredentials;
ReadBatchSize = readBatchSize;
MaxPushQueueSize = maxPushQueueSize;
EventAppeared = eventAppeared;
_liveProcessingStarted = liveProcessingStarted;
_subscriptionDropped = subscriptionDropped;
Verbose = verboseLogging;
}
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:31,代码来源:EventStoreCatchUpSubscription.cs
示例9: Start
public static void Start()
{
var node = EmbeddedVNodeBuilder.
AsSingleNode().
OnDefaultEndpoints().
RunInMemory().
Build();
node.Start();
var tcs = new TaskCompletionSource<object>();
node.NodeStatusChanged += (sender, args) =>
{
if (args.NewVNodeState == VNodeState.Master)
tcs.SetResult(null);
};
tcs.Task.Wait();
Node = node;
Credentials = new UserCredentials("admin", "changeit");
var connection = EmbeddedEventStoreConnection.Create(Node);
// This does not work, because ... ††† JEZUS †††
//var connection = EventStoreConnection.Create(
// ConnectionSettings.Create().SetDefaultUserCredentials(Credentials).UseDebugLogger(),
// new IPEndPoint(Opts.InternalIpDefault, Opts.ExternalTcpPortDefault));
connection.ConnectAsync().Wait();
Connection = connection;
}
开发者ID:andrewm1986,项目名称:AggregateSource,代码行数:26,代码来源:EmbeddedEventStore.cs
示例10: EventStoreTransaction
/// <summary>
/// Constructs a new <see cref="EventStoreTransaction"/>
/// </summary>
/// <param name="transactionId">The transaction id of the transaction</param>
/// <param name="userCredentials">User credentials under which transaction is committed.</param>
/// <param name="connection">The connection the transaction is hooked to</param>
internal EventStoreTransaction(long transactionId, UserCredentials userCredentials, IEventStoreTransactionConnection connection)
{
Ensure.Nonnegative(transactionId, "transactionId");
TransactionId = transactionId;
_userCredentials = userCredentials;
_connection = connection;
}
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:14,代码来源:EventStoreTransaction.cs
示例11: BudgetProjection
public BudgetProjection(Budget budget, IPEndPoint endpoint, UserCredentials credentials, IAdaptEvents adapter, string stream)
: base(endpoint, credentials, adapter, stream)
{
_budget = budget;
_checkPoints = new Dictionary<string, CheckPoint>();
_lines = new List<BudgetLine>();
}
开发者ID:valeriob,项目名称:MyBudget,代码行数:8,代码来源:BudgetProjection.cs
示例12: ProjectionManager
public ProjectionManager(IPEndPoint endpoint, UserCredentials credentials, IAdaptEvents adapter)
{
_adapter = adapter;
_endpoint = endpoint;
_credentials = credentials;
_budgetLines = new Dictionary<string, BudgetLinesProjection>();
_budget = new Dictionary<string, BudgetProjection>();
}
开发者ID:valeriob,项目名称:MyBudget,代码行数:8,代码来源:ProjectionManager.cs
示例13: CreateTransient
public Task CreateTransient(IPEndPoint endPoint, string name, string query, UserCredentials userCredentials = null)
{
return SendPost(
endPoint.ToHttpUrl("/projections/transient?name={0}&type=JS", name),
query,
userCredentials,
HttpStatusCode.Created);
}
开发者ID:EventStore,项目名称:EventStore,代码行数:8,代码来源:ProjectionsClient.cs
示例14: DeleteStreamAsync
public Task<DeleteResult> DeleteStreamAsync(string stream, int expectedVersion, bool hardDelete, UserCredentials userCredentials = null)
{
Ensure.NotNullOrEmpty(stream, "stream");
var source = new TaskCompletionSource<DeleteResult>();
EnqueueOperation(new DeleteStreamOperation(_settings.Log, source, _settings.RequireMaster,
stream, expectedVersion, hardDelete, userCredentials));
return source.Task;
}
开发者ID:adbrowne,项目名称:EventStore,代码行数:9,代码来源:EventStoreNodeConnection.cs
示例15: EventStore
public EventStore(IPEndPoint endpoint, UserCredentials credentials, IAdaptEvents adapter)
{
_endpoint = endpoint;
_credentials = credentials;
_adapter = adapter;
_con = EventStoreConnection.Create(endpoint);
_con.Connect();
}
开发者ID:valeriob,项目名称:MyBudget,代码行数:9,代码来源:EventStore.cs
示例16: OuroStreamFactory
public OuroStreamFactory(
ILogger<IEventStore> logger,
IEventStoreConnection eventStore,
UserCredentials credentials)
{
_logger = logger;
_eventStore = eventStore;
_credentials = credentials;
}
开发者ID:mhwk,项目名称:spray-chronicle,代码行数:9,代码来源:OuroStreamFactory.cs
示例17: Delete
public void Delete(string url, UserCredentials userCredentials,
Action<HttpResponse> onSuccess, Action<Exception> onException)
{
Ensure.NotNull(url, "url");
Ensure.NotNull(onSuccess, "onSuccess");
Ensure.NotNull(onException, "onException");
Receive(HttpMethod.Delete, url, userCredentials, onSuccess, onException);
}
开发者ID:EventStore,项目名称:EventStore,代码行数:9,代码来源:HttpAsyncClient.cs
示例18: EventFactory
public EventFactory(UserCredentials credentials, IEventStoreConnection connection)
{
_closedEvent = new ClosedEvent(credentials, connection);
_openedEvent = new OpenedEvent(credentials, connection);
_registerBreakerEvent = new RegisterBreakerEvent(credentials, connection);
_tryingToCloseEvent = new TryingToCloseEvent(credentials, connection);
_unregisterBreakerEvent = new UnregisterBreakerEvent(credentials, connection);
_tolleratedOpenEvent = new TolleratedOpenEvent(credentials, connection);
}
开发者ID:RokitSalad,项目名称:Helpful.CircuitBreaker.Events.EventStore,代码行数:9,代码来源:EventFactory.cs
示例19: Create
public static Repository<User> Create(UnitOfWork unitOfWork, IEventStoreConnection connection, UserCredentials credentials)
{
return new Repository<User>(() => User.Factory(), unitOfWork, connection,
new EventReaderConfiguration(
new SliceSize(512),
new JsonDeserializer(),
new PassThroughStreamNameResolver(),
new FixedStreamUserCredentialsResolver(credentials)));
}
开发者ID:rmacdonaldsmith,项目名称:EventSourcedUserService,代码行数:9,代码来源:RepositoryFactory.cs
示例20: Get
public void Get(string url, UserCredentials userCredentials, TimeSpan timeout,
Action<HttpResponse> onSuccess, Action<Exception> onException)
{
Ensure.NotNull(url, "url");
Ensure.NotNull(onSuccess, "onSuccess");
Ensure.NotNull(onException, "onException");
Receive(HttpMethod.Get, url, userCredentials, timeout, onSuccess, onException);
}
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:9,代码来源:HttpAsyncClient.cs
注:本文中的EventStore.ClientAPI.SystemData.UserCredentials类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论