Skip to content
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

Validate config from external docs #99

Merged
merged 6 commits into from
Sep 14, 2020
Merged

Conversation

iffyio
Copy link
Collaborator

@iffyio iffyio commented Sep 8, 2020

Doing this required some refactoring to make it easier to
validate Config without having to e.g pass in logger, filter registry
etc. This adds a dedicated server builder for configuring and
validating a Config before creating a Server.

Doing this required some refactoring to make it easier to
validate Config without having to e.g pass in logger, filter registry
etc. This adds a dedicated server builder for configuring and
validating a Config before creating a Server.
Copy link
Contributor

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some general questions around some names but this is pretty sweet.

docs/extensions/filters/local_rate_limit.md Show resolved Hide resolved
docs/extensions/filters/debug.md Outdated Show resolved Hide resolved
src/extensions/filter_chain.rs Show resolved Hide resolved
src/extensions/filter_chain.rs Show resolved Hide resolved
/// registry for the set of available filters
filter_registry: FilterRegistry,
metrics: Metrics,
pub(in crate::proxy) log: Logger,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know you could do that - very nice. Might be worth putting a comment here about why we need access to these variables from crate::proxy -- I'm assuming its because of the builder?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! this was because of the builder, added comment!

src/proxy/server_builder.rs Outdated Show resolved Hide resolved
}

/// Represents the components needed to create a Server.
pub struct ServerBuilder<V> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder rather than ServerBuilder?

Just thinking it might be nice to have quilkin::proxy::builder::Builder - not wedded to it, just wondering if the thought stuck.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

src/proxy/server_builder.rs Outdated Show resolved Hide resolved
@markmandel
Copy link
Contributor

Oops! Looks like the rename broke the doc tests (which is great that we have them!)

---- src/lib.rs - external_doc_tests (line 100) stdout ----
error[E0433]: failed to resolve: could not find `ServerBuilder` in `proxy`
  --> src/lib.rs:118:19
   |
20 |   quilkin::proxy::ServerBuilder::from(std::sync::Arc::new(config)).validate().unwrap();
   |                   ^^^^^^^^^^^^^ could not find `ServerBuilder` in `proxy`

Other than that, this is good to go for sure! Nice stuff!

@markmandel markmandel added kind/cleanup Refactoring code, fixing up documentation, etc kind/documentation Improvements or additions to documentation labels Sep 14, 2020
Copy link
Contributor

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this in there!

@markmandel markmandel merged commit c196f69 into master Sep 14, 2020
@markmandel markmandel deleted the iu/validate-config-from-docs branch September 14, 2020 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes kind/cleanup Refactoring code, fixing up documentation, etc kind/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants