protocol

package
v0.0.0-...-f1b2c4c Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ONE_RPC_VERSION = 1

Variables

This section is empty.

Functions

func AddProxy

func AddProxy(name string, dpr dispatcher, imp interface{}) error

func NewClientProtocol

func NewClientProtocol(name string, conf *transport.OneCltConf) transport.CltProtocol

Types

type ClientProtocol

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

func (*ClientProtocol) ParsePkg

func (ocp *ClientProtocol) ParsePkg(pkg []byte) (int, int)

func (*ClientProtocol) Recv

func (ocp *ClientProtocol) Recv(pkg []byte)

func (*ClientProtocol) Send

func (ocp *ClientProtocol) Send(reqId int32, servant, funcName string, pkg []byte) (rspPkg []byte, err error)

func (*ClientProtocol) String

func (ocp *ClientProtocol) String() string

type Logger

type Logger interface {
	Debug(msg ...interface{})
	Info(msg ...interface{})
	Warn(msg ...interface{})
	Error(msg ...interface{})

	Debugf(tpl string, args ...interface{})
	Infof(tpl string, args ...interface{})
	Warnf(tpl string, args ...interface{})
	Errorf(tpl string, args ...interface{})
}

type ServerProtocl

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

func NewServerProtocol

func NewServerProtocol(dpr dispatcher, imp interface{}, logger Logger) *ServerProtocl

func (*ServerProtocl) Invoke

func (p *ServerProtocl) Invoke(ctx context.Context, req []byte) []byte

func (*ServerProtocl) InvokeTimeout

func (p *ServerProtocl) InvokeTimeout(ctx context.Context, req []byte) []byte

func (*ServerProtocl) ParsePkg

func (p *ServerProtocl) ParsePkg(pkg []byte) (int, int)

Directories

Path Synopsis
res

Jump to

Keyboard shortcuts

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