transport

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v2.1.0

type Client interface {
	// Call 调用服务方法
	Call(ctx context.Context, service, method string, args interface{}, reply interface{}, opts ...interface{}) error
	// Client 获取内部客户端
	Client() interface{}
}

type NewMeshClient added in v2.1.0

type NewMeshClient func(target string) (Client, error)

type Server

type Server interface {
	// Start 启动服务器
	Start() error
	// Stop 停止服务器
	Stop() error
	// Addr 监听地址
	Addr() string
	// Scheme 协议
	Scheme() string
	// Endpoint 服务端口
	Endpoint() *endpoint.Endpoint
	// RegisterService 注册服务
	RegisterService(desc, service interface{}) error
}

type Transporter

type Transporter interface {
	// Name 获取传输器组件名
	Name() string
	// NewServer 新建传输服务器
	NewServer() (Server, error)
	// NewClient 新建传输务客户端
	// target参数可分为三种模式:
	// 服务直连模式: 	direct://127.0.0.1:8011
	// 服务直连模式: 	direct://711baf8d-8a06-11ef-b7df-f4f19e1f0070
	// 服务发现模式: 	discovery://service_name
	NewClient(target string) (Client, error)
	// SetDefaultDiscovery 设置默认的服务发现组件
	SetDefaultDiscovery(discovery registry.Discovery)
}

Jump to

Keyboard shortcuts

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