Description
Is your feature request related to a problem? Please describe.
now, when we use client 、producer、consumer, we must provide ClientOption
, ProducerOption
and ConsumerOption
, but there are many params on Option, which puzzle users.
according to Rob Pike: https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html and Dave cheney: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis , we should use WithXXX. for example:
type ClientOption func(opts ClientOptions)
func WithURL(URL string) ClientOption {
return func(opts ClientOptions) {
.....
}
}
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Activity