body

package
v0.0.0-...-5e9c659 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TBody

type TBody struct {
	Data  *bytes.Buffer // 存储已经编码的数据
	Codec codec.ICodec
	// contains filtered or unexported fields
}

NOTED 不提供IO Reader/Writer/Closer

func New

func New(coder codec.ICodec, data ...interface{}) *TBody

func (*TBody) AsBuffer

func (self *TBody) AsBuffer() *bytes.Buffer

func (*TBody) AsBytes

func (self *TBody) AsBytes() (res []byte)

the boady data in bytes

func (*TBody) AsMap

func (self *TBody) AsMap(c ...codec.SerializeType) (map[string]interface{}, error)

TODO 优化 根据序列强制转换为Map

func (*TBody) AsRecordset

func (self *TBody) AsRecordset(c ...codec.SerializeType) (rec *dataset.TRecordSet, err error)

根据序列强制转换为TRecordSet 默认为codec.JSON

func (*TBody) Decode

func (self *TBody) Decode(out interface{}) (err error)

mapping to data type

func (*TBody) Encode

func (self *TBody) Encode(in interface{}) (int, error)

func (*TBody) Reset

func (self *TBody) Reset() error

Jump to

Keyboard shortcuts

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