Documentation ¶
Overview ¶
Copyright (C) 2019 tisnyo <[email protected]>.
A Pip can used for frame data transfer. It can transfer text header content and byte content such as file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeFromObject ¶
DeserializeFromObject deserialize an byte array to an interface by type.
func DeserializeFromType ¶
DeserializeFromType deserialize an byte array to an interface by type.
Types ¶
type Pip ¶
Pip is a tcp pipe manager which controls the reception and sending of frames.
func (*Pip) Receive ¶
func (pip *Pip) Receive( headerObject interface{}, handler func(filledHeaderObject interface{}, bodyReader io.Reader, bodyLength int64) error, ) error
Receive receives a frame by it's pip. headerObject is an interface which will be used to load header data, handler is a callback function with which you can handle a data frame, parameter filledMetaObject of function handler and headerObject are the same object. filledHeaderObject is data-filled header Object.