forked from TrueCloudLab/frostfs-api
Merge pull request #18 from nspcc-dev/feature/extended-request-headers
service: support extended headers of the request
This commit is contained in:
commit
4e5fa4f9e4
2 changed files with 43 additions and 0 deletions
|
@ -6,6 +6,8 @@
|
|||
- [service/meta.proto](#service/meta.proto)
|
||||
|
||||
- Messages
|
||||
- [RequestExtendedHeader](#service.RequestExtendedHeader)
|
||||
- [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV)
|
||||
- [RequestMetaHeader](#service.RequestMetaHeader)
|
||||
- [ResponseMetaHeader](#service.ResponseMetaHeader)
|
||||
|
||||
|
@ -35,6 +37,29 @@
|
|||
<!-- end services -->
|
||||
|
||||
|
||||
<a name="service.RequestExtendedHeader"></a>
|
||||
|
||||
### Message RequestExtendedHeader
|
||||
RequestExtendedHeader contains extended headers of request
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| Headers | [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) | repeated | Headers carries list of key-value headers |
|
||||
|
||||
|
||||
<a name="service.RequestExtendedHeader.KV"></a>
|
||||
|
||||
### Message RequestExtendedHeader.KV
|
||||
KV contains string key-value pair
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| K | [string](#string) | | K carries extended header key |
|
||||
| V | [string](#string) | | V carries extra header value |
|
||||
|
||||
|
||||
<a name="service.RequestMetaHeader"></a>
|
||||
|
||||
### Message RequestMetaHeader
|
||||
|
@ -48,6 +73,7 @@ RequestMetaHeader contains information about request meta headers
|
|||
| Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value |
|
||||
| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future |
|
||||
| Raw | [bool](#bool) | | Raw determines whether the request is raw or not |
|
||||
| ExtendedHeader | [RequestExtendedHeader](#service.RequestExtendedHeader) | | ExtendedHeader carries extended headers of the request |
|
||||
|
||||
|
||||
<a name="service.ResponseMetaHeader"></a>
|
||||
|
|
|
@ -19,6 +19,8 @@ message RequestMetaHeader {
|
|||
uint32 Version = 3;
|
||||
// Raw determines whether the request is raw or not
|
||||
bool Raw = 4;
|
||||
// ExtendedHeader carries extended headers of the request
|
||||
RequestExtendedHeader ExtendedHeader = 5 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// ResponseMetaHeader contains meta information based on request processing by server
|
||||
|
@ -30,3 +32,18 @@ message ResponseMetaHeader {
|
|||
// TODO: not used for now, should be implemented in future
|
||||
uint32 Version = 2;
|
||||
}
|
||||
|
||||
// RequestExtendedHeader contains extended headers of request
|
||||
message RequestExtendedHeader {
|
||||
// KV contains string key-value pair
|
||||
message KV {
|
||||
// K carries extended header key
|
||||
string K = 1;
|
||||
|
||||
// V carries extended header value
|
||||
string V = 2;
|
||||
}
|
||||
|
||||
// Headers carries list of key-value headers
|
||||
repeated KV Headers = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue