gopack

package module
v0.0.0-...-5cf3864 Latest Latest
Warning

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

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

README

gopack

介绍

golang 语言编写的 数据转byte 包,用于socket通信中的压包和解包

软件架构

软件架构说明

a	以NUL字节填充字符串
A	以SPACE(空格)填充字符串
h	十六进制字符串,低位在前
H	十六进制字符串,高位在前
c	有符号字符
C	无符号字符
s	有符号短整型(16位,主机字节序)
S	无符号短整型(16位,主机字节序)
n	无符号短整型(16位,大端字节序)
v	无符号短整型(16位,小端字节序)
i	有符号整型(机器相关大小字节序)
I	无符号整型(机器相关大小字节序)
l	有符号长整型(32位,主机字节序)
L	无符号长整型(32位,主机字节序)
N	无符号长整型(32位,大端字节序)
V	无符号长整型(32位,小端字节序)
q	有符号长长整型(64位,主机字节序)
Q	无符号长长整型(64位,主机字节序)
J	无符号长长整型(64位,大端字节序)
P	无符号长长整型(64位,小端字节序)
f	单精度浮点型(机器相关大小)
g	单精度浮点型(机器相关大小,小端字节序)
G	单精度浮点型(机器相关大小,大端字节序)
d	双精度浮点型(机器相关大小)
e	双精度浮点型(机器相关大小,小端字节序)
E	双精度浮点型(机器相关大小,大端字节序)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol struct {
	Format []string
}

The protocol is pack and unpack of promise

func (*Protocol) Pack

func (pro *Protocol) Pack(args ...interface{}) ([]byte, error)

打包

func (*Protocol) Unpack

func (pro *Protocol) Unpack(content []byte) ([]interface{}, error)

解包

Jump to

Keyboard shortcuts

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