Documentation
¶
Index ¶
- Variables
- func ReadPacket(r io.Reader) (packet []byte, err error)
- func WritePacket(w io.Writer, packet []byte) (n int, err error)
- type BytesDecoder
- func (d *BytesDecoder) GetBytes() ([]byte, error)
- func (d *BytesDecoder) GetInt16() (int16, error)
- func (d *BytesDecoder) GetInt32() (int32, error)
- func (d *BytesDecoder) GetInt32Array() ([]int32, error)
- func (d *BytesDecoder) GetInt64() (int64, error)
- func (d *BytesDecoder) GetInt64Array() ([]int64, error)
- func (d *BytesDecoder) GetInt8() (int8, error)
- func (d *BytesDecoder) GetNullString() (NullString, error)
- func (d *BytesDecoder) GetRaw(n int) ([]byte, error)
- func (d *BytesDecoder) GetString() (string, error)
- func (d *BytesDecoder) Pop() error
- func (d *BytesDecoder) Push(in DeferredDecoder) error
- func (d *BytesDecoder) Rest() []byte
- type BytesEncoder
- func (e *BytesEncoder) Bytes() []byte
- func (e *BytesEncoder) Pop() error
- func (e *BytesEncoder) Push(in DeferredEncoder)
- func (e *BytesEncoder) PutBytes(in []byte) error
- func (e *BytesEncoder) PutInt16(in int16)
- func (e *BytesEncoder) PutInt32(in int32)
- func (e *BytesEncoder) PutInt32Array(in []int32) error
- func (e *BytesEncoder) PutInt64(in int64)
- func (e *BytesEncoder) PutInt64Array(in []int64) error
- func (e *BytesEncoder) PutInt8(in int8)
- func (e *BytesEncoder) PutNullString(in NullString) error
- func (e *BytesEncoder) PutRaw(in []byte)
- func (e *BytesEncoder) PutString(in string) error
- type CRC32Field
- type Decoder
- type DecodingError
- type DeferredDecoder
- type DeferredEncoder
- type Encoder
- type LengthField
- type NullString
- type PacketDecoder
- type PacketEncoder
- type RequestHeader
- type ResponseHeader
Constants ¶
This section is empty.
Variables ¶
View Source
var EncodingError = errors.New("kafka: Error while encoding packet.")
View Source
var InsufficientData = errors.New("kafka: Insufficient data while decoding packet.")
View Source
var PacketSizeError = errors.New("kafka: Unsupported packet size.")
Functions ¶
Types ¶
type BytesDecoder ¶
type BytesDecoder struct {
// contains filtered or unexported fields
}
func NewBytesDecoder ¶
func NewBytesDecoder(buf []byte) *BytesDecoder
func (*BytesDecoder) GetBytes ¶
func (d *BytesDecoder) GetBytes() ([]byte, error)
func (*BytesDecoder) GetInt16 ¶
func (d *BytesDecoder) GetInt16() (int16, error)
func (*BytesDecoder) GetInt32 ¶
func (d *BytesDecoder) GetInt32() (int32, error)
func (*BytesDecoder) GetInt32Array ¶
func (d *BytesDecoder) GetInt32Array() ([]int32, error)
func (*BytesDecoder) GetInt64 ¶
func (d *BytesDecoder) GetInt64() (int64, error)
func (*BytesDecoder) GetInt64Array ¶
func (d *BytesDecoder) GetInt64Array() ([]int64, error)
func (*BytesDecoder) GetInt8 ¶
func (d *BytesDecoder) GetInt8() (int8, error)
func (*BytesDecoder) GetNullString ¶
func (d *BytesDecoder) GetNullString() (NullString, error)
func (*BytesDecoder) GetString ¶
func (d *BytesDecoder) GetString() (string, error)
func (*BytesDecoder) Pop ¶
func (d *BytesDecoder) Pop() error
func (*BytesDecoder) Push ¶
func (d *BytesDecoder) Push(in DeferredDecoder) error
func (*BytesDecoder) Rest ¶
func (d *BytesDecoder) Rest() []byte
type BytesEncoder ¶
type BytesEncoder struct {
// contains filtered or unexported fields
}
func NewBytesEncoder ¶
func NewBytesEncoder() *BytesEncoder
func (*BytesEncoder) Bytes ¶
func (e *BytesEncoder) Bytes() []byte
func (*BytesEncoder) Pop ¶
func (e *BytesEncoder) Pop() error
func (*BytesEncoder) Push ¶
func (e *BytesEncoder) Push(in DeferredEncoder)
func (*BytesEncoder) PutBytes ¶
func (e *BytesEncoder) PutBytes(in []byte) error
func (*BytesEncoder) PutInt16 ¶
func (e *BytesEncoder) PutInt16(in int16)
func (*BytesEncoder) PutInt32 ¶
func (e *BytesEncoder) PutInt32(in int32)
func (*BytesEncoder) PutInt32Array ¶
func (e *BytesEncoder) PutInt32Array(in []int32) error
func (*BytesEncoder) PutInt64 ¶
func (e *BytesEncoder) PutInt64(in int64)
func (*BytesEncoder) PutInt64Array ¶
func (e *BytesEncoder) PutInt64Array(in []int64) error
func (*BytesEncoder) PutInt8 ¶
func (e *BytesEncoder) PutInt8(in int8)
func (*BytesEncoder) PutNullString ¶
func (e *BytesEncoder) PutNullString(in NullString) error
func (*BytesEncoder) PutRaw ¶
func (e *BytesEncoder) PutRaw(in []byte)
func (*BytesEncoder) PutString ¶
func (e *BytesEncoder) PutString(in string) error
type CRC32Field ¶
type CRC32Field struct{}
func (CRC32Field) Decode ¶
func (c CRC32Field) Decode(buf []byte) error
func (CRC32Field) Encode ¶
func (c CRC32Field) Encode(buf []byte) error
func (CRC32Field) Length ¶
func (c CRC32Field) Length() int
type Decoder ¶
type Decoder interface {
Decode(pd PacketDecoder) error
}
type DecodingError ¶
type DecodingError string
func (DecodingError) Error ¶
func (err DecodingError) Error() string
type DeferredDecoder ¶
type DeferredEncoder ¶
type Encoder ¶
type Encoder interface {
Encode(pe PacketEncoder) error
}
type LengthField ¶
type LengthField struct{}
func (LengthField) Decode ¶
func (l LengthField) Decode(buf []byte) error
func (LengthField) Encode ¶
func (l LengthField) Encode(buf []byte) error
func (LengthField) Length ¶
func (l LengthField) Length() int
type NullString ¶
type PacketDecoder ¶
type PacketDecoder interface { GetInt8() (int8, error) GetInt16() (int16, error) GetInt32() (int32, error) GetInt64() (int64, error) GetRaw(n int) ([]byte, error) GetBytes() ([]byte, error) GetString() (string, error) GetNullString() (NullString, error) GetInt32Array() ([]int32, error) GetInt64Array() ([]int64, error) Push(in DeferredDecoder) error Pop() error }
type PacketEncoder ¶
type PacketEncoder interface { PutInt8(in int8) PutInt16(in int16) PutInt32(in int32) PutInt64(in int64) PutRaw(in []byte) PutBytes(in []byte) error PutString(in string) error PutNullString(in NullString) error PutInt32Array(in []int32) error PutInt64Array(in []int64) error Push(in DeferredEncoder) Pop() error }
type RequestHeader ¶
func (*RequestHeader) Decode ¶
func (h *RequestHeader) Decode(pd PacketDecoder) (err error)
func (*RequestHeader) Encode ¶
func (h *RequestHeader) Encode(pe PacketEncoder) (err error)
type ResponseHeader ¶
type ResponseHeader struct {
CorrelationId int32
}
func (*ResponseHeader) Decode ¶
func (h *ResponseHeader) Decode(pd PacketDecoder) (err error)
func (*ResponseHeader) Encode ¶
func (h *ResponseHeader) Encode(pe PacketEncoder) (err error)
Click to show internal directories.
Click to hide internal directories.