Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultTagName that enables serialization. DefaultTagName = "serialize" // TagValue is the value the tag must have to be serialized. TagValue = "true" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { Registry MarshalInto(interface{}, *wrappers.Packer) error Unmarshal([]byte, interface{}) error }
Codec marshals and unmarshals
func NewDefault ¶
func NewDefault() Codec
NewDefault returns a new codec with reasonable default values
type Manager ¶ added in v1.0.6
type Manager interface { // Associate the given codec with the given version ID RegisterCodec(version uint16, codec Codec) error // Define the maximum size, in bytes, of something serialized/deserialized // by this codec manager SetMaxSize(int) // Marshal the given value using the codec with the given version. // RegisterCodec must have been called with that version. Marshal(version uint16, source interface{}) (destination []byte, err error) // Unmarshal the given bytes into the given destination. [destination] must // be a pointer or an interface. Returns the version of the codec that // produces the given bytes. Unmarshal(source []byte, destination interface{}) (version uint16, err error) }
Manager describes the functionality for managing codec versions.
func NewDefaultManager ¶ added in v1.0.6
func NewDefaultManager() Manager
NewDefaultManager returns a new codec manager.
func NewManager ¶ added in v1.0.6
NewManager returns a new codec manager.
Click to show internal directories.
Click to hide internal directories.