Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataPackage ¶
DataPackage .
func (*DataPackage) Marshal ¶
func (d *DataPackage) Marshal(buf []byte) ([]byte, error)
Marshal DataPackage.
func (*DataPackage) Unmarshal ¶
func (d *DataPackage) Unmarshal(buf []byte) (uint64, error)
Unmarshal DataPackage.
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
Package is a container for net message.
func NewPackage ¶
NewPackage . @Description: create a Package contains message payload with protocol. @param protocol: @param payload: @return *Package:
func (*Package) FromBytes ¶
FromBytes . @Description: parse bytes received from receive stream into Package. @receiver m @param data: @return error:
func (*Package) Payload ¶
Payload . @Description: return the message payload bytes. @receiver m @return []byte:
func (*Package) Protocol ¶
Protocol . @Description: return the protocol id that the message marked. @receiver m @return string:
Click to show internal directories.
Click to hide internal directories.