Skip to content
Snippets Groups Projects
Commit 4fc5c5bd 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 f6b1d6af 22202f87
No related branches found
No related tags found
No related merge requests found
......@@ -12,5 +12,5 @@ const (
)
const (
ECHO = "$echo"
ECHO = "Echo"
)
......@@ -32,6 +32,10 @@ func NewProxy(invoke protocol.Invoker, callBack interface{}, attachments map[str
}
// proxy implement
// In consumer, RPCService like:
// type XxxProvider struct {
// Yyy func(ctx context.Context, args []interface{}, rsp *Zzz) error
// }
func (p *Proxy) Implement(v config.RPCService) error {
// check parameters, incoming interface must be a elem's pointer.
......
package imp
import (
log "github.com/AlexStocks/log4go"
)
import (
"github.com/dubbo/dubbo-go/common/constant"
"github.com/dubbo/dubbo-go/common/extension"
......@@ -13,11 +17,14 @@ func init() {
extension.SetFilter(ECHO, GetFilter)
}
// RPCService need a Echo method in consumer, if you want to use EchoFilter
// eg:
// Echo func(ctx context.Context, args []interface{}, rsp *Xxx) error
type EchoFilter struct {
}
func (ef *EchoFilter) Invoke(invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
log.Info("invoking echo filter.")
if invocation.MethodName() == constant.ECHO && len(invocation.Arguments()) == 1 {
return &protocol.RPCResult{
Rest: invocation.Arguments()[0],
......
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