Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializableFromSnappy ¶
func DeserializableFromSnappy(encoded []byte, dest Deserializable) error
DeserializableFromSnappy wraps FromSnappy, allowing any type which implements Deserializable to be passed, decoded, and deserialized in one step. God help you if this doesn't work.
func FromSnappy ¶
FromSnappy decompresses a []byte slice using the s2 implementation of snappy's de/compression algo. s2.Decode() is _sometimes_ compatible with data compressed by standard Snappy implementations..
func SerializableToSnappy ¶
func SerializableToSnappy(data Serializable) ([]byte, error)
SerializableToSnappy wraps ToSnappy, allowing any type which implements Serializable to be passed, serialized, and encoded in one step. Note that SerializableToSnappy can return an error if data.Serialize() returns an error.
Types ¶
type Deserializable ¶
Deserializable is implemented by any type with a Deserialize method, which can do essentially anything with a []byte to achieve either something useful or return an error.
type Serializable ¶
Serializable is implemented by any type with a Serialize method, which can do essentially anything to achieve a final ([]byte, error) result.
type SerializableDeserializable ¶
type SerializableDeserializable interface { Serializable Deserializable }
SerializableDeserializable is any type which implements both Serializable and Deserializable.