-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: expose Dialer and add DialerOptions #7
Conversation
options.go
Outdated
} | ||
} | ||
|
||
// WithCredentialsFile returns a DialerOption that specifies a service account or refresh token JSON credentials to be used as the basis for authentication. |
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 docstring is identical to the one above. Maybe we just crib from the options package for these functions since they're basically call-throughs?
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.
Not sure I understand what you mean by crib - can you expand?
If you mean just housing the options in the api/options
package and asking for a ClientOptions
type in the Dialer instead, I didn't do that because there will be non-client specific options in the future.
If you mean adding a WithClientOption
that allows the user to specify a client option, it felt both clunkier to double wrap options but I'm not sure we want to expose all ClientOptions to the user. This way lets us limit which Options can be used, and lets us potentially add more complexity to under the hood to how these options are applied (if we need too).
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'm just suggesting we tighten up the docstring here to call out the difference with the function below.
// defaultDialer provides the singleton dialer as a default for dial functions. | ||
func defaultDialer() (*dialManager, error) { | ||
// getDefaultDialer provides the singleton dialer as a default for dial functions. | ||
func getDefaultDialer() (*Dialer, error) { |
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.
Exports a Dialer object that can be used to configure the Dialer behavior.