-
Notifications
You must be signed in to change notification settings - Fork 0
/
annales.proto
81 lines (66 loc) · 1.66 KB
/
annales.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
/*
Annales Event Store API
Copyright (C) 2023, Alessandro Santini
All Rights Reserved.
Published under the Apache-2.0 license, see LICENSE for more information.
*/
syntax = "proto3";
package annales;
option go_package = "github.com/spoletum/annales";
option java_package = "com.spoletum.annales";
// An event as it is returned from the Get event
message Event {
string stream_id = 2;
int64 version = 3;
string event_type = 4;
string encoding = 5;
string source = 7;
bytes data = 8;
string timestamp = 9;
}
message AppendEventRequest {
string stream_id = 1;
int64 expected_version = 2;
string event_type = 3;
string encoding = 4;
string source = 6;
bytes data = 7;
}
message AppendEventResponse {
}
message GetStreamEventsRequest {
string stream_id = 1;
}
message GetStreamEventsResponse {
repeated Event events = 1;
}
message GetStreamInfoRequest {
string stream_id = 1;
}
message GetStreamInfoResponse {
int64 version = 1;
}
message GetEventRequest {
string stream_id = 1;
int64 version = 2;
}
message GetEventResponse {
Event event = 1;
}
message GetMetricsRequest {
}
message GetMetricsResponse {
int64 append_requests = 1;
int64 read_requests = 2;
int64 events_read = 3;
int64 cache_misses = 4;
int64 cache_hits = 5;
int64 cache_size = 6;
}
service Journal {
rpc AppendEvent(AppendEventRequest) returns (AppendEventResponse) {}
rpc GetStreamEvents(GetStreamEventsRequest) returns (GetStreamEventsResponse) {}
rpc GetStreamInfo(GetStreamInfoRequest) returns (GetStreamInfoResponse) {}
rpc GetEvent(GetEventRequest) returns (GetEventResponse) {}
rpc GetMetrics(GetMetricsRequest) returns (GetMetricsResponse) {}
}