Skip to content
Snippets Groups Projects
Commit 9b3a29ec authored by fangyincheng's avatar fangyincheng
Browse files

Mod:format

parent e50832b2
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 ...@@ -51,5 +51,6 @@ func (factory *DefaultProxyFactory) GetProxy(invoker protocol.Invoker, url *comm
return proxy.NewProxy(invoker, nil, attachments) return proxy.NewProxy(invoker, nil, attachments)
} }
func (factory *DefaultProxyFactory) GetInvoker(url common.URL) protocol.Invoker { 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 ...@@ -20,7 +20,6 @@ package dubbo
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/apache/dubbo-go/protocol"
"net/url" "net/url"
"reflect" "reflect"
"sync" "sync"
...@@ -37,6 +36,7 @@ import ( ...@@ -37,6 +36,7 @@ import (
"github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/invocation" "github.com/apache/dubbo-go/protocol/invocation"
) )
......
...@@ -17,14 +17,17 @@ ...@@ -17,14 +17,17 @@
package jsonrpc package jsonrpc
import (
"strings"
"sync"
)
import ( import (
"github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/config" "github.com/apache/dubbo-go/config"
"github.com/apache/dubbo-go/protocol" "github.com/apache/dubbo-go/protocol"
"strings"
"sync"
) )
const JSONRPC = "jsonrpc" const JSONRPC = "jsonrpc"
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
package directory package directory
import ( import (
"github.com/apache/dubbo-go/remoting"
"sync" "sync"
"time" "time"
) )
...@@ -36,6 +35,7 @@ import ( ...@@ -36,6 +35,7 @@ import (
"github.com/apache/dubbo-go/protocol" "github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/protocolwrapper" "github.com/apache/dubbo-go/protocol/protocolwrapper"
"github.com/apache/dubbo-go/registry" "github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/remoting"
) )
const ( 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