message

package
v0.1.60 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeReq added in v0.1.44

func EncodeReq(req *Request) []byte

func EncodeResp added in v0.1.44

func EncodeResp(resp *Response) []byte

Types

type Request

type Request struct {
	HeadLength uint32
	BodyLength uint32
	RequestID  uint32
	Version    uint8
	Compresser uint8
	Serializer uint8

	ServiceName string
	MethodName  string
	Meta        map[string]string

	Data []byte
}

func DecodeReq added in v0.1.44

func DecodeReq(data []byte) *Request

func (*Request) CalculateBodyLength added in v0.1.44

func (req *Request) CalculateBodyLength()

func (*Request) CalculateHeaderLength added in v0.1.44

func (req *Request) CalculateHeaderLength()

type Response

type Response struct {
	HeadLength uint32
	BodyLength uint32
	RequestID  uint32
	Version    uint8
	Compresser uint8
	Serializer uint8
	Error      []byte

	Data []byte
}

func DecodeResp added in v0.1.44

func DecodeResp(data []byte) *Response

func (*Response) CalculateBodyLength added in v0.1.44

func (resp *Response) CalculateBodyLength()

func (*Response) CalculateHeaderLength added in v0.1.44

func (resp *Response) CalculateHeaderLength()

Jump to

Keyboard shortcuts

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