Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { Encode(v interface{}) ([]byte, error) Decode(data []byte, target interface{}) error }
A Codec can encode and decode values.
func String ¶
func String() Codec
String encodes and decodes strings or byte slices into themselves. It is useful when passing raw data without touching it. The Encode method takes a byte slice, string, stringer or error and returns a byte slice. The Decode method turns data into v without touching it. v must be a pointer to byte slice or a pointer to string.
type Decoder ¶
A Decoder decodes encoded data. It can be decoded to an arbitrary value using the Decode method.
func Float64Decoder ¶
Float64Decoder returns a decoder using the Float64 codec.
func Int64Decoder ¶
Int64Decoder returns a decoder using the Int64 codec.
func JSONDecoder ¶
JSONDecoder returns a decoder using the JSON codec.
func NewDecoder ¶
NewDecoder creates a decoder using the given codec.
func StringDecoder ¶
StringDecoder returns a decoder using the String codec.
type Encoder ¶
Encoder is a simple interface for any type that can be encoded as an array of bytes in order to be sent as the key or value of a Kafka message. It matches the sarama.Encoder interface.
func Float64Encoder ¶
Float64Encoder creates a Encoder that encodes using the Float64 Codec.
func Int64Encoder ¶
Int64Encoder creates a Encoder that encodes using the Int64 codec.
func JSONEncoder ¶
func JSONEncoder(v interface{}) Encoder
JSONEncoder creates a Encoder that encodes using the JSON Codec.
func StringEncoder ¶
StringEncoder creates a Encoder that encodes using the String codec.