rpcx

package module
v2.0.0-...-298d81c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options)

func WithClientCredentials

func WithClientCredentials(caFile string, serverName string) Option

WithClientCredentials 设置客户端证书和校验域名

func WithClientDiscovery

func WithClientDiscovery(discovery registry.Discovery) Option

WithClientDiscovery 设置客户端服务发现组件

func WithClientPoolSize

func WithClientPoolSize(size int) Option

WithClientPoolSize 设置客户端连接池大小

func WithServerAddr

func WithServerAddr(addr string) Option

WithServerAddr 设置服务器监听地址

func WithServerCredentials

func WithServerCredentials(certFile, keyFile string) Option

WithServerCredentials 设置服务器证书和秘钥

func WithServerExpose

func WithServerExpose(expose bool) Option

WithServerExpose 设置是否将内部通信地址暴露到公网

type Transporter

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

func NewTransporter

func NewTransporter(opts ...Option) *Transporter

func (*Transporter) Name

func (t *Transporter) Name() string

Name 获取传输器组件名

func (*Transporter) NewClient

func (t *Transporter) NewClient(target string) (transport.Client, error)

NewClient 新建传输客户端 target参数可分为三种模式: 服务直连模式: direct://127.0.0.1:8011 服务直连模式: direct://711baf8d-8a06-11ef-b7df-f4f19e1f0070 服务发现模式: discovery://service_name

func (*Transporter) NewServer

func (t *Transporter) NewServer() (transport.Server, error)

NewServer 新建传输服务器

func (*Transporter) SetDefaultDiscovery

func (t *Transporter) SetDefaultDiscovery(discovery registry.Discovery)

SetDefaultDiscovery 设置默认的服务发现组件

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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