Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { Marshaler Unmarshaler }
Codec is a combination of Unmarshaler and Marshaler
type Compressor ¶
Compressor compress and decompress the given data
func NewGzipCompressor ¶
func NewGzipCompressor() Compressor
func NewS2Compressor ¶
func NewS2Compressor() Compressor
type DefaultCompressor ¶
type DefaultCompressor struct {
// contains filtered or unexported fields
}
func (*DefaultCompressor) Compress ¶
func (c *DefaultCompressor) Compress(data []byte) ([]byte, error)
func (*DefaultCompressor) Decompress ¶
func (c *DefaultCompressor) Decompress(data []byte) ([]byte, error)
type GobCodec ¶
type GobCodec struct {
// contains filtered or unexported fields
}
func NewGobCodec ¶
func NewGobCodec(compressor Compressor) *GobCodec
type JsonCodec ¶
type JsonCodec struct {
// contains filtered or unexported fields
}
func NewJsonCodec ¶
func NewJsonCodec(compressor Compressor) *JsonCodec
type MsgPackCodec ¶
type MsgPackCodec struct {
// contains filtered or unexported fields
}
func NewMsgPackCodec ¶
func NewMsgPackCodec(compressor Compressor) *MsgPackCodec
func (*MsgPackCodec) Marshal ¶
func (c *MsgPackCodec) Marshal(value interface{}) ([]byte, error)
func (*MsgPackCodec) Unmarshal ¶
func (c *MsgPackCodec) Unmarshal(byt []byte, ptr interface{}) (err error)
type Unmarshaler ¶
Unmarshaler transforms bytes produced by Marshal back into a Go object
Click to show internal directories.
Click to hide internal directories.