rpc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 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 Server

type Server interface {
	// Start 启动服务器
	Start(ctx context.Context) error

	// Stop 停止服务器
	Stop(ctx context.Context) error

	// Endpoint 返回服务器的端点URL
	Endpoint() (*url.URL, error)

	// Engine 返回底层的RPC引擎,允许直接访问底层实现
	// 注意:这可能会导致与底层实现的耦合,应谨慎使用
	Engine() any

	// RegisterService 注册一个服务到RPC服务器
	RegisterService(desc any, impl any) Server
}

Server 定义了RPC服务器的基本接口

func NewServer

func NewServer(method string, opts ...ServerOptions) Server

NewServer 创建一个新的RPC服务器实例

type ServerOptions

type ServerOptions interface{}

ServerOptions 定义了创建服务器的选项

Directories

Path Synopsis
internal/serverinterceptors
auth check by jwt
auth check by jwt

Jump to

Keyboard shortcuts

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