Documentation
¶
Index ¶
- Constants
- func DecompressAndLoad(data []byte, format uint8, t interface{}) (interface{}, error)
- func Dump(t interface{}, format uint8) ([]byte, error)
- func DumpAndCompress(t interface{}, format uint8, compression uint8) ([]byte, error)
- func DumpIndent(t interface{}, format uint8, indent string) ([]byte, error)
- func Load(data []byte, t interface{}) (interface{}, error)
- func LoadAsFormat(data []byte, format uint8, t interface{}) (interface{}, error)
- type GenCodeCompatible
Constants ¶
const ( AUTO = 0 NONE = 1 // Special types. LIST = 76 // L // Serialization types. BSON = 66 // B CBOR = 67 // C GenCode = 71 // G JSON = 74 // J STRING = 83 // S BYTES = 88 // X // Compression types. GZIP = 90 // Z )
Types.
Variables ¶
This section is empty.
Functions ¶
func DecompressAndLoad ¶ added in v0.4.1
DecompressAndLoad decompresses the data using the specified compression format and then loads the resulting data blob into the interface.
func DumpAndCompress ¶ added in v0.4.1
DumpAndCompress stores the interface as a dsd formatted data structure and compresses the resulting data.
func DumpIndent ¶ added in v0.4.1
DumpIndent stores the interface as a dsd formatted data structure with indentation, if available.
func LoadAsFormat ¶
LoadAsFormat loads a data blob into the interface using the specified format.
Types ¶
type GenCodeCompatible ¶ added in v0.3.0
type GenCodeCompatible interface {
// GenCodeMarshal gencode marshalls the struct into the given byte array, or a new one if its too small.
GenCodeMarshal(buf []byte) ([]byte, error)
// GenCodeUnmarshal gencode unmarshalls the struct and returns the bytes read.
GenCodeUnmarshal(buf []byte) (uint64, error)
}
GenCodeCompatible is an interface to identify and use gencode compatible structs.