-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add new ResolverWithOpts #5
Conversation
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
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.
A few things I noticed.
- We used to pass a
context.Context
toResolver()
. Do we not need it anymore? - In other areas, functions to set options passed as variadic parameters always were named
With*
, which would make theseWithResolverOptClient(client *http.Client)
orWithResolverOptPlainHTTP()
. Should we be consistent in the naming? - whether or not to use plain http is a boolean, which defaults to false. If the only thing we will do is set it to true, then it probably should just be
ResolverOptPlainHTTP()
(orWithResolverOptPlainHTTP()
, not parameter required
Right now, just a comment.
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
@deitch -
It's actually not needed. The original implementation was just throwing it away (
Yes, agree. Done.
Done. |
This will allow us to add new options to Resolver without breaking API in the future.
In the near term, this allows us to set a custom User-Agent header:
Resolves oras-project/oras#240