rpc

package
v0.0.0-...-4cd9d19 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnInit

func OnInit(s core.IService, opt ...Option) (err error)

func OnRegisterRpcData

func OnRegisterRpcData(d interface{}, sf func(d interface{}) ([]byte, error), unsf func(dataType reflect.Type, d []byte) (interface{}, error))

func Register

func Register(id string, f interface{}) (err error)

func RegisterGO

func RegisterGO(id string, f interface{}) (err error)

func RpcId

func RpcId() (rpcId string, err error)

func UnRegister

func UnRegister(id string, f interface{}) (err error)

Types

type IRpcClient

type IRpcClient interface {
	Done() (err error)
	Call(_func string, params ...interface{}) (interface{}, error)
	CallNR(_func string, params ...interface{}) (err error)
}

func NewRpcClient

func NewRpcClient(sId, rId string) (clent IRpcClient, err error)

type IRpcServer

type IRpcServer interface {
	RpcId() string
	Register(id string, f interface{})
	RegisterGO(id string, f interface{})
	UnRegister(id string, f interface{})
	Done() (err error)
}

type Option

type Option func(*Options)

func Id

func Id(v string) Option

func Log

func Log(v bool) Option

func MaxCoroutine

func MaxCoroutine(v int) Option

func NatsAddr

func NatsAddr(v string) Option

func RpcExpired

func RpcExpired(v int) Option

type Options

type Options struct {
	NatsAddr     string
	MaxCoroutine int
	RpcExpired   int
	Log          bool
	// contains filtered or unexported fields
}

Directories

Path Synopsis
Package rpcpb is a generated protocol buffer package.
Package rpcpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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