Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mizrael committed Dec 12, 2023
1 parent 730849d commit c151c88
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/EvenireDB/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{
internal record Event : IEvent
{
public Event(Guid id, string type, ReadOnlyMemory<byte> data)
public Event(EventId id, string type, ReadOnlyMemory<byte> data)
{
Id = id;
Type = type;
Data = data;
}

public Guid Id { get; }
public EventId Id { get; }
public string Type { get; }
public ReadOnlyMemory<byte> Data { get; }
}
Expand Down
14 changes: 14 additions & 0 deletions src/EvenireDB/EventId.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace EvenireDB
{
public readonly struct EventId
{
public EventId(long timestamp, int sequence)
{
Timestamp = timestamp;
Sequence = sequence;
}

public long Timestamp { get; }
public int Sequence { get; }
}
}
2 changes: 1 addition & 1 deletion src/EvenireDB/IEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace EvenireDB
{
public interface IEvent
{
Guid Id { get; } // TODO: consider using a timestamp instead, like Redis streams
EventId Id { get; } // TODO: consider using a timestamp instead, like Redis streams
string Type { get; }
ReadOnlyMemory<byte> Data { get; }
}
Expand Down

0 comments on commit c151c88

Please sign in to comment.