L2ncE commented on code in PR #2379:
URL: https://github.com/apache/dubbo-go/pull/2379#discussion_r1295578825
##########
provider/provider.go:
##########
@@ -0,0 +1,48 @@
+package provider
+
+import (
+ "context"
+ "dubbo.apache.org/dubbo-go/v3/protocol"
+)
+
+type Provider struct {
+ invoker protocol.Invoker
+ info *ServiceInfo
+ cfg *ServiceConfig
+}
+
+// Register assemble invoker chains like ProviderConfig.Load, init a service
per call
+func (pro *Provider) Register(handler interface{}, info *ServiceInfo, opts
...RegisterOptions) error {
+ // put information from info to url
+ // ProviderConfig.Load
+
+ // url
+ return nil
+}
+
+// meta
+type ServiceInfo struct {
+ InterfaceName string
+ ServiceType interface{}
+ Methods []MethodInfo
+ Meta map[string]interface{}
+}
+
+type MethodInfo struct {
+ Name string
+ Type string
+ ReqInitFunc func() interface{}
+ StreamInitFunc func(baseStream interface{}) interface{}
+ MethodFunc func(ctx context.Context, args []interface{}, handler
interface{}) (interface{}, error)
+ Meta map[string]interface{}
+}
+
+func NewProvider(opts ...ServiceOption) (*Provider, error) {
Review Comment:
done
##########
common/constant/key.go:
##########
@@ -416,3 +416,10 @@ const (
MetricsMetadata = "dubbo.metrics.metadata"
MetricApp = "dubbo.metrics.app"
)
+
+// default meta cache config
+const (
+ DefaultMetaCacheName = "dubbo.meta"
+ DefaultMetaFileName = "dubbo.metadata"
+ DefaultEntrySize = 100
+)
Review Comment:
done
--
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]