idlrpc

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProxy added in v0.3.0

func AddProxy(proxy proxy.Proxy) error

AddProxy add remote service proxy to framework

func AddProxyCreator added in v0.3.1

func AddProxyCreator(uuid uint64, pc proxy.ProxyCreator) error

func AddStubCreator added in v0.3.1

func AddStubCreator(uuid uint64, bc stub.StubCreator) error

func Call

func Call(proxyId proxy.ProxyId, methodId, timeout uint32, retry int32, message proto.Message) (resp *protocol.ResponsePackage, err error)

Call service proxy call remote sync

func GetProxyFromPeer added in v0.3.0

func GetProxyFromPeer(sCall *stub.StubCall) proxy.Proxy

func GetProxyManager added in v0.3.0

func GetProxyManager() *proxy.ProxyManager

func GetStubManager added in v0.3.0

func GetStubManager() *stub.StubManager

func Init added in v0.3.1

func Init() error

Init you can do some init operator in this function TODO add rpc init config

func OnMessage

func OnMessage(trans transport.Transport, ctx context.Context)

OnMessage try to create one rpc message

func RegisterService

func RegisterService(service IService) error

RegisterService register user impl service struct to framework

func SetRpcLogger added in v0.3.1

func SetRpcLogger(logger rlog.RpcLogger)

SetRpcLogger replace rpc framework logger

func Start

func Start()

Start start rpc framework

func Tick

func Tick()

Tick tick rpc frame work

Types

type IService added in v0.3.1

type IService interface {

	// GetUUID service uuid, generated by rpc-repo
	GetUUID() uint64

	// OnAfterFork init service by framework, user can init some custom data in this function
	OnAfterFork() bool

	// OnTick tick your service the same goroutine
	OnTick() bool

	// OnBeforeDestroy before service unload, you can clean your own data in this func
	OnBeforeDestroy() bool
}

IService user custom service framework interface

type ServiceCreator added in v0.3.1

type ServiceCreator func(interface{}) IService

ServiceCreator service creator

Directories

Path Synopsis
goidltool module
idl2go module
internal

Jump to

Keyboard shortcuts

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