Skip to content

Commit

Permalink
Doc: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyongjia committed Jan 27, 2021
1 parent 7883fd9 commit 8d734cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewProxy(invoke protocol.Invoker, callback interface{}, attachments map[str
WithProxyImplementFunc(DefaultProxyImplementFunc))
}

// NewProxy create service proxy.
// NewProxyWithOptions create service proxy with options.
func NewProxyWithOptions(invoke protocol.Invoker, callback interface{}, attachments map[string]string, opts ...ProxyOption) *Proxy {
p := &Proxy{
invoke: invoke,
Expand All @@ -76,6 +76,7 @@ func NewProxyWithOptions(invoke protocol.Invoker, callback interface{}, attachme
return p
}

// WithProxyImplementFunc an option function to setup proxy.ImplementFunc
func WithProxyImplementFunc(f ImplementFunc) ProxyOption {
return func(p *Proxy) {
p.implement = f
Expand Down Expand Up @@ -110,6 +111,7 @@ func (p *Proxy) GetInvoker() protocol.Invoker {
return p.invoke
}

// DefaultProxyImplementFunc the default function for proxy impl
func DefaultProxyImplementFunc(p *Proxy, v common.RPCService) {
// check parameters, incoming interface must be a elem's pointer.
valueOf := reflect.ValueOf(v)
Expand Down

0 comments on commit 8d734cb

Please sign in to comment.