From 16101b7d84cebf35e855ba0e30ab6d7d552e2385 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:13:07 +0300 Subject: [PATCH] proto: add version of protocol into meta header --- service/meta.go | 12 +++++++++++- service/meta.proto | 5 +++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/service/meta.go b/service/meta.go index 52874c12..1e3fcc86 100644 --- a/service/meta.go +++ b/service/meta.go @@ -10,6 +10,7 @@ type ( // MetaHeader contains meta information of request. // It provides methods to get or set meta information meta header. // Also contains methods to reset and restore meta header. + // Also contains methods to get or set request protocol version MetaHeader interface { ResetMeta() RequestMetaHeader RestoreMeta(RequestMetaHeader) @@ -20,7 +21,16 @@ type ( // EpochRequest gives possibility to get or set epoch in RPC Requests. 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. diff --git a/service/meta.proto b/service/meta.proto index 4c09fb3c..62866d20 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -7,6 +7,7 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; message RequestMetaHeader { - uint32 TTL = 1; - uint64 Epoch = 2; + uint32 TTL = 1; + uint64 Epoch = 2; + uint32 Version = 3; }