client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 16 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 proto.Message, resp proto.Message) (err error)

func Client

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

func NewRpcxClientPool

func NewRpcxClientPool(name string, 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"`
	DialDiscovery      string        `toml:"discovery"`
	DialFailMode       string        `toml:"fail_mode"`
	DialSelectMode     string        `toml:"select_mode"`
	DialConnectTimeout time.Duration `toml:"dial_timeout"`

	// zookeeper register
	DiscoveryZkBasePath string `toml:"discovery_zk_basepath"`

	// nacos register
	RegisterNcNamespaceId string `toml:"register_nc_namespace_id"`
	RegisterNcCacheDir    string `toml:"register_nc_cache_dir"`
	RegisterNcLogDir      string `toml:"register_nc_log_dir"`
	RegisterNcLogLevel    string `toml:"register_nc_log_level"`
	RegisterNcAccessKey   string `toml:"register_nc_access_key"`
	RegisterNcSecretKey   string `toml:"register_nc_secret_key"`

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

Jump to

Keyboard shortcuts

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