proto: add version of protocol into meta header

This commit is contained in:
Evgeniy Kulikov 2019-11-21 15:13:07 +03:00
parent 4efb4dafe8
commit 16101b7d84
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
2 changed files with 14 additions and 3 deletions

View file

@ -10,6 +10,7 @@ type (
// MetaHeader contains meta information of request. // MetaHeader contains meta information of request.
// It provides methods to get or set meta information meta header. // It provides methods to get or set meta information meta header.
// Also contains methods to reset and restore meta header. // Also contains methods to reset and restore meta header.
// Also contains methods to get or set request protocol version
MetaHeader interface { MetaHeader interface {
ResetMeta() RequestMetaHeader ResetMeta() RequestMetaHeader
RestoreMeta(RequestMetaHeader) RestoreMeta(RequestMetaHeader)
@ -20,7 +21,16 @@ type (
// EpochRequest gives possibility to get or set epoch in RPC Requests. // EpochRequest gives possibility to get or set epoch in RPC Requests.
GetEpoch() uint64 GetEpoch() uint64
SetEpoch(v uint64) SetEpoch(uint64)
// VersionHeader allows get or set version of protocol request
VersionHeader
}
// VersionHeader allows get or set version of protocol request
VersionHeader interface {
GetVersion() uint32
SetVersion(uint32)
} }
// TTLCondition is closure, that allows to validate request with ttl. // TTLCondition is closure, that allows to validate request with ttl.

View file

@ -9,4 +9,5 @@ option (gogoproto.stable_marshaler_all) = true;
message RequestMetaHeader { message RequestMetaHeader {
uint32 TTL = 1; uint32 TTL = 1;
uint64 Epoch = 2; uint64 Epoch = 2;
uint32 Version = 3;
} }