This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 531
/
message.proto
51 lines (45 loc) · 1.49 KB
/
message.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
package message;
import "gogo.proto";
option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
message Header {
enum HmacHashFunction {
MD5 = 0;
SHA1 = 1;
}
required uint32 message_length = 1; // length in bytes
optional HmacHashFunction hmac_hash_function = 3 [default = MD5];
optional string hmac_signer = 4;
optional uint32 hmac_key_version = 5;
optional bytes hmac = 6;
}
message Field {
enum ValueType {
STRING = 0;
BYTES = 1;
INTEGER = 2;
DOUBLE = 3;
BOOL = 4;
}
required string name = 1;
optional ValueType value_type = 2 [default = STRING];
optional string representation = 3;
repeated string value_string = 4;
repeated bytes value_bytes = 5;
repeated int64 value_integer = 6 [packed=true];
repeated double value_double = 7 [packed=true];
repeated bool value_bool = 8 [packed=true];
}
message Message {
required bytes uuid = 1;
required int64 timestamp = 2; // nanoseconds since UNIX epoch
optional string type = 3;
optional string logger = 4;
optional int32 severity = 5 [default = 7];
optional string payload = 6;
optional string env_version = 7;
optional int32 pid = 8;
optional string hostname = 9;
repeated Field fields = 10;
}