base

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MulanPSL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerSession

func NewServerSession(app module.App, name string, node *registry.Node) (module.ServerSession, error)

NewServerSession 创建一个节点实例

Types

type DefaultModule

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

DefaultModule 模块结构

type Module

type Module struct {
	context.Context

	App module.App
	// contains filtered or unexported fields
}

func (*Module) Call

func (m *Module) Call(ctx context.Context, serviceName string, fnc func(context.Context, *grpc.ClientConn) error) error

func (*Module) GetApp

func (m *Module) GetApp() module.App

func (*Module) GetClient

func (m *Module) GetClient(serviceName string) (error, *grpc.ClientConn)

func (*Module) GetServer

func (m *Module) GetServer() server.Server

func (*Module) GetServerID

func (m *Module) GetServerID() string

func (*Module) OnDestroy

func (m *Module) OnDestroy()

func (*Module) OnInit

func (m *Module) OnInit(subclass module.RPCModule, app module.App, opt ...server.Option)

type ModuleManager

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

ModuleManager 模块管理器

func NewModuleManager

func NewModuleManager() (m *ModuleManager)

NewModuleManager 新建模块管理器

func (*ModuleManager) Destroy

func (mer *ModuleManager) Destroy()

Destroy 停止模块

func (*ModuleManager) Init

func (mer *ModuleManager) Init(app module.App)

Init 初始化

func (*ModuleManager) Register

func (mer *ModuleManager) Register(mi module.Module, logger *glog.Logger)

Register 注册模块

func (*ModuleManager) RegisterRunMod

func (mer *ModuleManager) RegisterRunMod(mi module.Module)

RegisterRunMod 注册需要运行的模块

Jump to

Keyboard shortcuts

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