DMwangnima commented on code in PR #2445:
URL: https://github.com/apache/dubbo-go/pull/2445#discussion_r1356016208
##########
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:
If users do not specify any information about the protocol at all, server
would not serve any protocol. Maybe we should raise an error when users do not
provide any protocol configurations when initializing **ServerOptions**?
--
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]