proxy

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func BasePath

func BasePath(s string) Option

Base path of service

func ChanCallSize

func ChanCallSize(s int) Option

Size of agent call chan. Default is 20

func ChanRetSize

func ChanRetSize(s int) Option

Size of return chan which is callback of rpc. Default is 10

func RegistryAddr

func RegistryAddr(s string) Option

Address of register service

func RegistryType

func RegistryType(s string) Option

Register service type. option is consul, etcd, etcdv3, zookeeper.

func RpcPoolSize

func RpcPoolSize(s int) Option

Size of the rpcx client pool. Default is 1.

func SelectMode added in v1.0.1

func SelectMode(s string) Option

Select mode of service. options is "RandomSelect","RoundRobin","WeightedRoundRobin","WeightedICMP","ConsistentHash","Closest".

type Options

type Options struct {
	RegistryType string
	RegistryAddr string
	BasePath     string
	SelectMode   string
	ChanCallSize int
	ChanRetSize  int
	RpcPoolSize  int
}

type Proxy

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

func NewProxy

func NewProxy(opts ...Option) *Proxy

func (*Proxy) Go

func (r *Proxy) Go(call *rpc.Call)

func (*Proxy) OnDestroy

func (r *Proxy) OnDestroy()

func (*Proxy) OnInit

func (r *Proxy) OnInit()

func (*Proxy) RpcCall

func (r *Proxy) RpcCall(servicePath string, serviceMethod string, args *rpc.Args, reply interface{}) error

func (*Proxy) Run

func (r *Proxy) Run(closeSig chan bool)

func (*Proxy) SetHandlerFilter added in v1.0.2

func (r *Proxy) SetHandlerFilter(f filter)

Set a filter for client handler

func (*Proxy) SetRpcFilter added in v1.0.2

func (r *Proxy) SetRpcFilter(f filter)

Set a filter for rpc

func (*Proxy) SetRpcResponder

func (r *Proxy) SetRpcResponder(resp rpc.RpcResponder)

Jump to

Keyboard shortcuts

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