proxy

package
v3.0.3-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultProxyImplementFunc

func DefaultProxyImplementFunc(p *Proxy, v common.RPCService)

DefaultProxyImplementFunc the default function for proxy impl

Types

type ImplementFunc

type ImplementFunc func(p *Proxy, v common.RPCService)

ImplementFunc function for proxy impl of RPCService functions

type Option

type Option func(ProxyFactory)

Option will define a function of handling ProxyFactory

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

nolint

func NewProxy

func NewProxy(invoke protocol.Invoker, callback interface{}, attachments map[string]string) *Proxy

NewProxy create service proxy.

func NewProxyWithOptions

func NewProxyWithOptions(invoke protocol.Invoker, callback interface{}, attachments map[string]string, opts ...ProxyOption) *Proxy

NewProxyWithOptions create service proxy with options.

func (*Proxy) Get

func (p *Proxy) Get() common.RPCService

Get gets rpc service instance.

func (*Proxy) GetCallback

func (p *Proxy) GetCallback() interface{}

GetCallback gets callback.

func (*Proxy) GetInvoker

func (p *Proxy) GetInvoker() protocol.Invoker

GetInvoker gets Invoker.

func (*Proxy) Implement

func (p *Proxy) Implement(v common.RPCService)

Implement proxy implement In consumer, RPCService like:

		type XxxProvider struct {
 		Yyy func(ctx context.Context, args []interface{}, rsp *Zzz) error
		}

type ProxyFactory

type ProxyFactory interface {
	GetProxy(invoker protocol.Invoker, url *common.URL) *Proxy
	GetAsyncProxy(invoker protocol.Invoker, callBack interface{}, url *common.URL) *Proxy
	GetInvoker(url *common.URL) protocol.Invoker
}

type ProxyOption

type ProxyOption func(p *Proxy)

ProxyOption a function to init Proxy with options

func WithProxyImplementFunc

func WithProxyImplementFunc(f ImplementFunc) ProxyOption

WithProxyImplementFunc an option function to setup proxy.ImplementFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL