client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(ctx context.Context, name string, method string, req Message, resp Message) (err error)

func Client

func Client(name string) (r client.XClient)

func NewRpcxClientPool

func NewRpcxClientPool(cfg *Cfg) (r *client.XClientPool, err error)

func Pool

func Pool(name string) (r *client.XClientPool)

func SafeClient

func SafeClient(name string) (r client.XClient, err error)

func SafePool

func SafePool(name string) (r *client.XClientPool, err error)

func Valid

func Valid(names ...string) (err error)

验证Rpcx实例的配置正确性与连通性。 参数names是实例的名称列表,如果为空则检测所有配置的实例

Types

type Cfg

type Cfg struct {
	// dial
	DialAddrs          []string      `toml:"addrs"`
	DialServerName     string        `toml:"server_name"` // default `Server`
	DialDiscovery      string        `toml:"discovery"`
	DialFailMode       string        `toml:"fail_mode"`
	DialSelectMode     string        `toml:"select_mode"`
	DialConnectTimeout time.Duration `toml:"dial_timeout"`

	// discovery, only support zookeeper
	DiscoveryBasePath string `toml:"discovery_base_path"` // only discovery

	// pool
	PoolMaxActive int `toml:"pool_max_active"` // 最大活跃连接数
}

type Message

type Message interface {
	proto.Message
	GetHeader() *pb.Header
}

Jump to

Keyboard shortcuts

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