-
Notifications
You must be signed in to change notification settings - Fork 98
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
Conversation
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.
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.
Just some general questions around some names but this is pretty sweet.
src/proxy/server.rs
Outdated
/// registry for the set of available filters | ||
filter_registry: FilterRegistry, | ||
metrics: Metrics, | ||
pub(in crate::proxy) log: Logger, |
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.
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?
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.
Yes! this was because of the builder, added comment!
src/proxy/server_builder.rs
Outdated
} | ||
|
||
/// Represents the components needed to create a Server. | ||
pub struct ServerBuilder<V> { |
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.
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.
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.
done!
Oops! Looks like the rename broke the doc tests (which is great that we have them!)
Other than that, this is good to go for sure! Nice stuff! |
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.
Let's get this in there!
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.