grpc

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager 管理 gRPC server/client 的注册与连接。

func NewManager

func NewManager() *Manager

NewManager 创建一个新的管理器实例。

func (*Manager) Close

func (m *Manager) Close() error

Close 关闭所有已注册客户端连接。

func (*Manager) GetClient

func (m *Manager) GetClient(name string) (*ggrpc.ClientConn, error)

GetClient 返回已注册的客户端连接。

func (*Manager) InitServer

func (m *Manager) InitServer(name string, keyFile string, certFile string) (*ggrpc.Server, error)

InitServer 根据已注册服务创建 gRPC Server。

func (*Manager) RegisterClient

func (m *Manager) RegisterClient(ctx context.Context, name string, target string, certFile string) error

RegisterClient 建立并缓存一个客户端连接。

func (*Manager) RegisterServer

func (m *Manager) RegisterServer(name string, server Server) error

RegisterServer 注册一个逻辑 gRPC 服务。

type Server

type Server interface {
	Register(gRPC *ggrpc.Server) error
}

Server 定义 gRPC 服务注册器。

Jump to

Keyboard shortcuts

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