-
Notifications
You must be signed in to change notification settings - Fork 34
/
endpoint.hpp
45 lines (35 loc) · 1008 Bytes
/
endpoint.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <cstdint>
#include "common/uri.hpp"
namespace kagome::telemetry {
/**
* Represents a single record of telemetry URI endpoint
* with verbosity level specified
*/
class TelemetryEndpoint {
public:
TelemetryEndpoint(common::Uri endpoint_uri, uint8_t verbosity_level)
: uri_{std::move(endpoint_uri)}, verbosity_level_{verbosity_level} {};
const common::Uri &uri() const {
return uri_;
}
uint8_t verbosity() const {
return verbosity_level_;
}
bool operator==(const TelemetryEndpoint &other) const {
return uri_.to_string() == other.uri_.to_string()
and verbosity_level_ == other.verbosity_level_;
}
bool operator!=(const TelemetryEndpoint &other) const {
return not operator==(other);
}
private:
common::Uri uri_;
uint8_t verbosity_level_;
};
} // namespace kagome::telemetry