DMwangnima commented on code in PR #2445:
URL: https://github.com/apache/dubbo-go/pull/2445#discussion_r1356014307
##########
protocol/options.go:
##########
@@ -27,12 +28,30 @@ import (
type Options struct {
Protocol *global.ProtocolConfig
+
+ ID string
}
-func DefaultOptions() *Options {
+func defaultOptions() *Options {
return &Options{Protocol: global.DefaultProtocolConfig()}
}
+func NewOptions(opts ...Option) *Options {
+ defOpts := defaultOptions()
+ for _, opt := range opts {
+ opt(defOpts)
+ }
+
+ if defOpts.Protocol.Name == "" {
+ panic(fmt.Sprintf("Please specify registry, eg. WithTriple()"))
Review Comment:
For unifying design principle of API, setting default value to **triple**
protocol and deleting ```WithTriple()``` make sense. But the consideration is
the same as registry configuration.
For instance, setting **zookeeper** as default registry is not intuitive to
users because **zookeeper** is not a de facto standard. Users often need to be
aware that the concrete registry they are using.
Likewise, **triple** is not a well-known protocol so that users need to
configure it clearly.
But now I think setting **triple** as default protocol could help us promote
it. **triple** could replace **http** and **grpc** in dubbo ecosphere. These is
only **dubbo** protocol that we need to take into separate consideration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]