xxbytes

package
v0.0.0-...-63b2ac5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalBinary

func MarshalBinary(txt string) (data []byte, err error)

Types

type BinText

type BinText string

类似这种的输出格式: [123 34 115 117 99 99 101 115 115 34 58 102 97 108 115 101 44 34 101 114 114 111 114 34 58 34 67 83 82 70 95 84 79 75 69 78 95 77 73 83 83 73 78 71 34 125]

func (BinText) MarshalBinary

func (txt BinText) MarshalBinary() (data []byte, err error)

func (BinText) MarshalText

func (txt BinText) MarshalText() (text []byte, err error)

type ByteParserRule

type ByteParserRule []*bytesstore

func (ByteParserRule) Parse

func (store ByteParserRule) Parse(datas []byte, noDelim bool) error

按照字节解析 按照定义的规则解析byte数据, nodelim: 解析的结果中,是否不保存分隔字符

type CountParserRule

type CountParserRule []*countStore

按照字符解析

func (CountParserRule) MarshalBinary

func (store CountParserRule) MarshalBinary() (data []byte, err error)

func (CountParserRule) Parse

func (store CountParserRule) Parse(datas []byte, noDelim bool) error

nodelim 这种选项应该实在构造rule时,进行设定的 比如10FF5E8F 按照2个字符类切分字节. 结果是[]byte{byte(10),byte(FF),byte(5E),byte(8F)} nodelim: 解析的结果中,是否不保存分隔字符 要切割的字节数据只支持ascii表中的字符

type RuleParser

type RuleParser interface {
	Parse(datas []byte, noDelim bool) error
}

type StringParserRule

type StringParserRule []*stringstore

按照字符解析

func (StringParserRule) Parse

func (store StringParserRule) Parse(datas []byte, noDelim bool) error

按照定义的规则解析byte数据, nodelim: 解析的结果中,是否不保存分隔字符

Jump to

Keyboard shortcuts

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