parse

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

README

封装协议说明:
MARK(4B)|CHAIN(1B)|MSGTYPE(2B)|DATALEN(4B)|DATA

MARK: 'XHWX'

CHAIN:	'R' :XServiceChainReal
		'V' :XServiceChainVirtual

MSGTYPE: 0: test_decoding 原始数据(BigEndian)


DATALEN:  data数据的长度(BigEndian)

DATA:	数据体

Documentation

Index

Constants

View Source
const (
	XServiceChainReal    = "real"
	XServiceChainVirtual = "virtual"
)

Variables

This section is empty.

Functions

func UnmarshalMessage

func UnmarshalMessage(data []byte, msg *Message) error

Types

type Body

type Body struct {
	Schema      string                 `json:"schema"`
	Table       string                 `json:"table"`
	Operation   string                 `json:"operation"`
	Data        map[string]interface{} `json:"data"`
	OperateTime int64                  `json:"operateTime"`
}

type Message

type Message struct {
	Body          Body   `json:"body"`
	XServiceChain string `json:"x_service_chain"`
}

Jump to

Keyboard shortcuts

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