service: refactor MetaHeader interface

This commit is contained in:
Leonard Lyubich 2020-05-04 14:37:14 +03:00
parent c38a8eddc8
commit eb94cf7549
11 changed files with 131 additions and 62 deletions

View file

@ -51,6 +51,12 @@ type TTLContainer interface {
SetTTL(uint32)
}
// SeizedMetaHeaderContainer is an interface of container of RequestMetaHeader that can be cut and restored.
type SeizedMetaHeaderContainer interface {
CutMeta() RequestMetaHeader
RestoreMeta(RequestMetaHeader)
}
// RequestMetaContainer is an interface of a fixed set of request meta value containers.
// Contains:
// - TTL value;
@ -64,6 +70,12 @@ type RequestMetaContainer interface {
RawContainer
}
// SeizedRequestMetaContainer is a RequestMetaContainer with seized meta.
type SeizedRequestMetaContainer interface {
RequestMetaContainer
SeizedMetaHeaderContainer
}
// VerbSource is an interface of the container of a token verb value with read access.
type VerbSource interface {
GetVerb() Token_Info_Verb