Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataPackage ¶
func (*DataPackage) Marshal ¶
func (d *DataPackage) Marshal(buf []byte) ([]byte, error)
func (*DataPackage) Size ¶
func (d *DataPackage) Size() (s uint64)
func (*DataPackage) Unmarshal ¶
func (d *DataPackage) Unmarshal(buf []byte) (uint64, error)
type ID ¶
type ID string
ID is an identifier used to mark the module which the net msg belong to.
const ( // TestingPID is a protocol id for testing. TestingPID ID = "/_testing" )
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
Package is a container for net message.
func NewPackage ¶
NewPackage create a Package contains message payload with protocol.
func (*Package) FromBytes ¶
FromBytes parse bytes received from receive stream into Package.
func (*Package) Payload ¶
Payload return the message payload bytes.
func (*Package) ProtocolID ¶
ProtocolID return the protocol id that the message marked.
Click to show internal directories.
Click to hide internal directories.