-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathego.proto
99 lines (87 loc) · 2.47 KB
/
ego.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
syntax = "proto3";
package ego.v1;
import "google/protobuf/any.proto";
option go_package = "github.com/tochemey/ego/v3;egopb";
// Event defines the event that needs to be persisted onto the events store
message Event {
// Specifies the persistence unique identifier
string persistence_id = 1;
// Specifies the sequence number
uint64 sequence_number = 2;
// Specifies the deletion state
bool is_deleted = 3;
// the event emitted
google.protobuf.Any event = 4;
// the state obtained from processing the event
google.protobuf.Any resulting_state = 5;
// Specifies the timestamp
int64 timestamp = 6;
// Specifies the shard number
uint64 shard = 7;
}
// CommandReply specifies the reply to a command sent to
// the aggregate
message CommandReply {
// the actual command reply
oneof reply {
// actual state is wrapped with metadata
StateReply state_reply = 1;
// gRPC failure
ErrorReply error_reply = 2;
}
}
// StateReply is a command reply.
// This is reply is used when there is a no-op
message StateReply {
// Specifies the persistence unique identifier
string persistence_id = 1;
// the entity state
google.protobuf.Any state = 2;
// Specifies the sequence number
uint64 sequence_number = 3;
// Specifies the timestamp
int64 timestamp = 4;
}
// ErrorReply is used when a command processing has
// failed.
message ErrorReply {
// Specifies the error message
string message = 1;
}
// NoReply is used when a command does not need a reply
message NoReply {}
// GetStateCommand tells the Aggregate
// to reply with its latest state
message GetStateCommand {}
// Offset defines the projection offset
message Offset {
// Specifies the shard number
uint64 shard_number = 1;
// Specifies the projection name.
string projection_name = 2;
// Specifies the value
int64 value = 3;
// Specifies the timestamp
int64 timestamp = 5;
}
// ProjectionId defines the projection id
message ProjectionId {
// Specifies the projection name
string projection_name = 1;
// Specifies the shard number
uint64 shard_number = 2;
}
// DurableState defines the durable state behavior
// actor
message DurableState {
// Specifies the persistence unique identifier
string persistence_id = 1;
// Specifies the version number
uint64 version_number = 2;
// the state obtained from processing a command
google.protobuf.Any resulting_state = 3;
// Specifies the timestamp
int64 timestamp = 5;
// Specifies the shard number
uint64 shard = 6;
}