#include <userver/baggage/baggage.hpp>
Baggage header. Contains entries (key, value, optional<properties>).
For more details on header check the official site https://w3c.github.io/baggage/
- See also
- baggage::BaggageManagerComponent
Definition at line 85 of file baggage.hpp.
|
| Baggage (std::string header, std::unordered_set< std::string > allowed_keys) |
|
| Baggage (const Baggage &) noexcept |
|
| Baggage (Baggage &&) noexcept |
|
std::string | ToString () const |
|
const std::vector< BaggageEntry > & | GetEntries () const |
|
bool | HasEntry (const std::string &key) const |
| check that header contains entry with selected key
|
|
const BaggageEntry & | GetEntry (const std::string &key) const |
| find first entry with selected key
|
|
bool | IsValidEntry (const std::string &key) const |
| entry's key validation
|
|
void | AddEntry (std::string key, std::string value, BaggageProperties properties) |
| Add entry to baggage header.
|
|
std::unordered_set< std::string > | GetAllowedKeys () const |
| get baggage allowed keys
|
|
|
static std::optional< BaggageEntryProperty > | TryMakeBaggageEntryProperty (std::string_view property) |
|
◆ AddEntry()
void baggage::Baggage::AddEntry |
( |
std::string | key, |
|
|
std::string | value, |
|
|
BaggageProperties | properties ) |
Add entry to baggage header.
- Exceptions
-
BaggageException | If key, value or properties don't match with requirements or if allowed_keys don't contain selected key |
◆ GetEntries()
const std::vector< BaggageEntry > & baggage::Baggage::GetEntries |
( |
| ) |
const |
◆ GetEntry()
const BaggageEntry & baggage::Baggage::GetEntry |
( |
const std::string & | key | ) |
const |
find first entry with selected key
- Exceptions
-
◆ TryMakeBaggageEntry()
std::optional< BaggageEntry > baggage::Baggage::TryMakeBaggageEntry |
( |
std::string_view | entry | ) |
|
|
protected |
parsers
- Returns
- std::nullopt If key, value or properties don't match with requirements or if allowed_keys don't contain selected key
The documentation for this class was generated from the following file: