Skip to content
Snippets Groups Projects
Commit 124bc37c authored by vito.he's avatar vito.he
Browse files

Merge branch 'develop-2.6.0' of https://github.com/dubbogo/dubbo-go into develop-2.6.0

parents 4bbc7115 31dba4e2
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,6 @@ func (p *Proxy) Implement(v interface{}) error {
argsInterface[k] = v.Interface()
}
//todo:call
inv := protocol.NewRPCInvocationForConsumer(methodName, nil, argsInterface, in[2].Interface(), p.callBack, p.attachments, nil)
result := p.invoke.Invoke(inv)
var err error
......
......@@ -10,6 +10,7 @@ import (
import (
"github.com/dubbo/dubbo-go/common/extension"
"github.com/dubbo/dubbo-go/common/proxy"
"github.com/dubbo/dubbo-go/config"
"github.com/dubbo/dubbo-go/protocol"
)
......@@ -18,11 +19,13 @@ var refprotocol = extension.GetProtocolExtension("registry")
type ReferenceConfig struct {
context context.Context
pxy *proxy.Proxy
Interface string `required:"true" yaml:"interface" json:"interface,omitempty"`
Registries []referenceConfigRegistry `required:"true" yaml:"registries" json:"registries,omitempty"`
Cluster string `default:"failover" yaml:"cluster" json:"cluster,omitempty"`
Methods []method `yaml:"methods" json:"methods,omitempty"`
URLs []config.URL `yaml:"-"`
Async bool `yaml:"async" json:"async,omitempty"`
invoker protocol.Invoker
}
type referenceConfigRegistry struct {
......@@ -49,7 +52,14 @@ func (refconfig *ReferenceConfig) Refer() {
} else {
//TODO:multi registries
}
//TODO:invoker yincheng 's proxy
//create proxy
attachments := map[string]string{} // todo : attachments is necessary, include keys: ASYNC_KEY、
refconfig.pxy = proxy.NewProxy(refconfig.invoker, nil, attachments)
}
// @v is service provider implemented RPCService
func (refconfig *ReferenceConfig) Implement(v interface{}) error {
return refconfig.pxy.Implement(v)
}
func (refconfig *ReferenceConfig) loadRegistries() []*config.RegistryURL {
......
package public
//////////////////////////////////////////
// codec type
//////////////////////////////////////////
type CodecType int
const (
CODECTYPE_UNKNOWN CodecType = iota
CODECTYPE_JSONRPC
CODECTYPE_DUBBO
)
var codecTypeStrings = [...]string{
"unknown",
"jsonrpc",
"dubbo",
}
func (c CodecType) String() string {
typ := CODECTYPE_UNKNOWN
switch c {
case CODECTYPE_JSONRPC:
typ = c
case CODECTYPE_DUBBO:
typ = c
}
return codecTypeStrings[typ]
}
func GetCodecType(t string) CodecType {
var typ = CODECTYPE_UNKNOWN
switch t {
case codecTypeStrings[CODECTYPE_JSONRPC]:
typ = CODECTYPE_JSONRPC
case codecTypeStrings[CODECTYPE_DUBBO]:
typ = CODECTYPE_DUBBO
}
return typ
}
package public
const (
DUBBOGO_CTX_KEY = "dubbogo-ctx"
)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment