Skip to content
Snippets Groups Projects
Commit 2468348c authored by fangyincheng's avatar fangyincheng
Browse files

Mod:format

parent 4e298b0b
No related branches found
No related tags found
No related merge requests found
package proxy
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/protocol"
)
type CallInvoker struct {
protocol.BaseInvoker
}
func NewCallInvoker(url common.URL) *CallInvoker {
return &CallInvoker{
BaseInvoker: *protocol.NewBaseInvoker(url),
}
}
func (bi *CallInvoker) Invoke(invocation protocol.Invocation) protocol.Result {
rpcResult := &protocol.RPCResult{Attrs: invocation.Attachments()}
//todo:call service
// get method
//proto := bi.GetUrl().Protocol
//if bi.GetUrl().SubURL != nil {
// proto = bi.GetUrl().SubURL.Protocol
//}
//svc := common.ServiceMap.GetService(proto, serviceName)
//if svc == nil {
// return perrors.New("cannot find svc " + serviceName)
//}
//method := svc.Method()[methodName]
//if method == nil {
// logger.Errorf("method not found!")
// rpcResult.Err = perrors.New("cannot find method " + methodName + " of svc " + serviceName)
// return rpcResult
//}
//
//returnValues := method.Method().Func.Call(in)
return rpcResult
}
......@@ -51,5 +51,6 @@ func (factory *DefaultProxyFactory) GetProxy(invoker protocol.Invoker, url *comm
return proxy.NewProxy(invoker, nil, attachments)
}
func (factory *DefaultProxyFactory) GetInvoker(url common.URL) protocol.Invoker {
return proxy.NewCallInvoker(url)
// todo: call service
return protocol.NewBaseInvoker(url)
}
......@@ -20,7 +20,6 @@ package dubbo
import (
"context"
"fmt"
"github.com/apache/dubbo-go/protocol"
"net/url"
"reflect"
"sync"
......@@ -37,6 +36,7 @@ import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/invocation"
)
......
......@@ -17,14 +17,17 @@
package jsonrpc
import (
"strings"
"sync"
)
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/config"
"github.com/apache/dubbo-go/protocol"
"strings"
"sync"
)
const JSONRPC = "jsonrpc"
......
......@@ -18,7 +18,6 @@
package directory
import (
"github.com/apache/dubbo-go/remoting"
"sync"
"time"
)
......@@ -36,6 +35,7 @@ import (
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/protocolwrapper"
"github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting"
)
const (
......
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