adapter

package
v0.0.0-...-55b5bdd Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MiniRpcFramer

type MiniRpcFramer struct{}

func (MiniRpcFramer) ReadFrame

func (mini MiniRpcFramer) ReadFrame(conn net.Conn) ([]byte, error)

magic(2) + len(2) + 保留(4) + pkg(len)

func (MiniRpcFramer) WriteFrame

func (mini MiniRpcFramer) WriteFrame(conn net.Conn, data []byte) error

type MiniRpcReqCoder

type MiniRpcReqCoder struct {
}

func (MiniRpcReqCoder) Decode

func (mini MiniRpcReqCoder) Decode(ctx core.RpcCtx, data []byte) ([]byte, error)

服务端收到[]byte, 从中解析出客户端上下文及业务请求包

func (MiniRpcReqCoder) Encode

func (mini MiniRpcReqCoder) Encode(ctx core.RpcCtx, body []byte) ([]byte, error)

把请求上下文及业务请求包,序列化为[]byte,发送到服务端

type MiniRpcRspCoder

type MiniRpcRspCoder struct {
}

func (MiniRpcRspCoder) Decode

func (mini MiniRpcRspCoder) Decode(ctx core.RpcCtx, data []byte) ([]byte, error)

客户端收到[]byte, 从中解析出服务端上下文及业务响应包

func (MiniRpcRspCoder) Encode

func (mini MiniRpcRspCoder) Encode(ctx core.RpcCtx, body []byte) ([]byte, error)

把服务端上下文及业务响应包,序列化为[]byte,发送到客户端

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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