proxy

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultProxyImplementFunc added in v1.5.6

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

DefaultProxyImplementFunc the default function for proxy impl

Types

type ImplementFunc added in v1.5.6

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 added in v1.5.6

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 added in v1.3.0

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

GetCallback gets callback.

func (*Proxy) GetInvoker added in v1.5.6

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
}

ProxyFactory interface.

type ProxyOption added in v1.5.6

type ProxyOption func(p *Proxy)

ProxyOption a function to init Proxy with options

func WithProxyImplementFunc added in v1.5.6

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