-
Notifications
You must be signed in to change notification settings - Fork 5.5k
rds: allow v1 rds config to use a v2 subscription #1583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,17 @@ class Utility { | |
| static std::chrono::milliseconds | ||
| apiConfigSourceRefreshDelay(const envoy::api::v2::ApiConfigSource& api_config_source); | ||
|
|
||
| /** | ||
| * Populate an envoy::api::v2::ApiConfigSource. | ||
| * @param cluster supplies the cluster name for the ApiConfigSource. | ||
| * @param refresh_delay_ms supplies the refresh delay for the ApiConfigSource in ms. | ||
| * @param api_type supplies the type of subscription to use for the ApiConfigSource. | ||
| * @param api_config_source a reference to the envoy::api::v2::ApiConfigSource object to populate. | ||
| */ | ||
| static void translateApiConfigSource(const std::string& cluster, uint32_t refresh_delay_ms, | ||
| const std::string& api_type, | ||
| envoy::api::v2::ApiConfigSource& api_config_source); | ||
|
|
||
| /** | ||
| * Check cluster info for API config sanity. Throws on error. | ||
| * @param error_prefix supplies the prefix to use in error messages. | ||
|
|
@@ -108,6 +119,10 @@ class Utility { | |
| static SubscriptionStats generateStats(Stats::Scope& scope) { | ||
| return {ALL_SUBSCRIPTION_STATS(POOL_COUNTER(scope))}; | ||
| } | ||
|
|
||
| static const std::string REST_LEGACY; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: This should use the const singleton pattern. See Http::Headers
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I am confused about this. If declare and initialize like in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You create a class with non-static members, and then access it via the static
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah gotcha, that pattern!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice this makes it better. I knew I had seen this as the Const counter part to the mutable singleton, should have scrolled to the end of the file. Another tool in the toolshed 👍 |
||
| static const std::string REST; | ||
| static const std::string GRPC; | ||
| }; | ||
|
|
||
| } // namespace Config | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be:
since the JSON schema knows this is an enum and has validated.