richGo

package module
v0.0.0-...-bcb4a85 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 11 Imported by: 0

README

richgo

Documentation

Index

Constants

View Source
const ETCD_BASE_PATH = "/richgo_modules"

Variables

This section is empty.

Functions

func RecoverError

func RecoverError()

Types

type Node

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

Node 在进程中只有一个,管理modules,存储配置等

func GetNode

func GetNode(config *viper.Viper) *Node

func (*Node) AddModule

func (n *Node) AddModule(module string, factory module.ModuleFactory)

func (*Node) Call

func (n *Node) Call(moduleTag, method string, args ...interface{}) interface{}

调用远程模块的方法,需要返回值

func (*Node) InitRClient

func (n *Node) InitRClient()

func (*Node) RegisterModules

func (n *Node) RegisterModules() error

注册所有module到etcd

func (*Node) RemoteCall

func (n *Node) RemoteCall(ctx context.Context, args *RemoteArgs, reply *RemoteReply) error

func (*Node) Send

func (n *Node) Send(moduleTag, method string, args ...interface{}) error

调用远程模块的方法,无需返回值

func (*Node) Start

func (n *Node) Start(nodeName string)

type RemoteArgs

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

type RemoteReply

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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