Documentation ¶
Index ¶
- func ByteDecode(bs []byte, obj interface{}, config ByteCodecConfig) error
- func ByteEncode(m interface{}, config ByteCodecConfig) ([]byte, error)
- func Bytes2IntFunc(bs []byte, config ByteCodecItemConfig) (int64, error)
- func GetDecodeFunc(str string) func(bs []byte, config ByteCodecItemConfig) (int64, error)
- func GetEncodeFunc(str string) func(v interface{}, config ByteCodecItemConfig) ([]byte, error)
- func Int2BytesFunc(v interface{}, config ByteCodecItemConfig) ([]byte, error)
- type ByteCodecConfig
- type ByteCodecItemConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteDecode ¶
func ByteDecode(bs []byte, obj interface{}, config ByteCodecConfig) error
func ByteEncode ¶
func ByteEncode(m interface{}, config ByteCodecConfig) ([]byte, error)
func Bytes2IntFunc ¶
func Bytes2IntFunc(bs []byte, config ByteCodecItemConfig) (int64, error)
func GetDecodeFunc ¶
func GetDecodeFunc(str string) func(bs []byte, config ByteCodecItemConfig) (int64, error)
func GetEncodeFunc ¶
func GetEncodeFunc(str string) func(v interface{}, config ByteCodecItemConfig) ([]byte, error)
func Int2BytesFunc ¶
func Int2BytesFunc(v interface{}, config ByteCodecItemConfig) ([]byte, error)
Types ¶
type ByteCodecConfig ¶
type ByteCodecConfig struct { Key string `json:"key"` // 转换标识 Total uint `json:"total"` //总长度 字节的长度 StructName string `json:"structName"` // 结构体的全路径 DspVersion string `json:"dspVersion"` // 下位机的版本 Items []ByteCodecItemConfig `json:"items"` //每项的设置 }
type ByteCodecItemConfig ¶
Click to show internal directories.
Click to hide internal directories.