proto

package
v0.0.0-...-942794f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMarshal

func DefaultMarshal(v interface{}) ([]byte, error)

基于struc包的序列化方案

func DefaultUnmarshal

func DefaultUnmarshal(data []byte, v interface{}) error

基于struc包的反序列化方案

Types

type Factory

type Factory func() (Marshaler, Unmarshaler, error)

type Marshaler

type Marshaler interface {
	Marshal() ([]byte, error)
}

type PacketHeader

type PacketHeader struct {
	Unknown1 uint `struc:"uint32,little";json:"unknown_1"`

	// B will be encoded/decoded as a 16-bit int (a "short")
	// but is stored as a native int in the struct
	Unknown2 uint `struc:"uint32,little";json:"unknown_2"`

	// the sizeof key links a buffer's size to any int field
	Unknown3 uint `struc:"uint32,little";json:"unknown_3"`
	ZipSize  int  `struc:"uint16,little";json:"zip_size"`

	// you can get freaky if you want
	UnzipSize int `struc:"uint16,little";json:"unzip_size"`
	// contains filtered or unexported fields
}

行情服务器发送第一条指令的返回数据

func (*PacketHeader) Bytes

func (h *PacketHeader) Bytes() []byte

func (*PacketHeader) Compressed

func (h *PacketHeader) Compressed() bool

func (*PacketHeader) Size

func (h *PacketHeader) Size() int

func (*PacketHeader) Unmarshal

func (h *PacketHeader) Unmarshal(data []byte) error

type Unmarshaler

type Unmarshaler interface {
	Unmarshal([]byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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