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; }
时间: 2024-10-24 12:52:57