Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
func Marshal(data interface{}, typ DataFormat) []byte
Marshal data of a specified type
func Unmarshal ¶
func Unmarshal(data []byte, typ DataFormat, target interface{})
Unmarshal data of a specified type into the target, which must be a pointer
Types ¶
type DataFormat ¶
type DataFormat uint
DataFormat is the type of data being received or sent
const ( GOB DataFormat = iota JSON )
String and JSON are the only supported data types
func StringToDataFormat ¶
func StringToDataFormat(str string) DataFormat
StringToDataFormat returns the DataFormat for a string
type DataType ¶
type DataType uint
DataType describes all types of data
func StringToDataType ¶
StringToDataType returns the DataType for a string
Click to show internal directories.
Click to hide internal directories.