Documentation ¶
Index ¶
- func ArrayMarshalJSON[T bool | float64 | int8 | int16 | uint16 | int32 | int64 | NullableString](key string, data []T) ([]byte, error)
- func ArrayOfStructMarshalJSON[T any](key string, data []T) ([]byte, error)
- func BytesMarshalJSON(key string, data []byte) ([]byte, error)
- func IsControlBatch(attributes int16) bool
- func IsTransactional(attributes int16) bool
- func MarshalPrimitiveTypeJSON[T bool | float64 | int8 | int16 | uint16 | int32 | int64 | NullableString](val T) ([]byte, error)
- func NullableStringSliceEqual(x, y []NullableString) bool
- func PrimitiveTypeSliceEqual[T bool | int8 | int16 | uint16 | int32 | int64 | float64, S []T](x, y S) bool
- func RawTaggedFieldsEqual(x, y []RawTaggedField) bool
- func WriteRawTaggedFields(buf *typesbytes.SliceWriter, taggedFields []RawTaggedField) error
- type Array
- type ArrayOfStruct
- type BatchRecord
- func (r *BatchRecord) Equal(that *BatchRecord) bool
- func (r *BatchRecord) Headers() []RecordHeader
- func (r *BatchRecord) Key() []byte
- func (r *BatchRecord) MarshalJSON() ([]byte, error)
- func (r *BatchRecord) OffsetDelta() int32
- func (r *BatchRecord) Read(rd *serialization.Reader) error
- func (r *BatchRecord) Release()
- func (r *BatchRecord) SetHeaders(headers []RecordHeader)
- func (r *BatchRecord) SetKey(key []byte)
- func (r *BatchRecord) SetOffsetDelta(offsetDelta int32)
- func (r *BatchRecord) SetTimestampDelta(timestampDelta int64)
- func (r *BatchRecord) SetValue(value []byte)
- func (r *BatchRecord) SizeInBytes() int
- func (r *BatchRecord) String() string
- func (r *BatchRecord) TimestampDelta() int64
- func (r *BatchRecord) Value() []byte
- func (r *BatchRecord) Write(w *serialization.Writer) error
- type Bool
- type Bytes
- type CompressionType
- type Context
- func (f *Context) IsFlexibleVersion(version int16) bool
- func (f *Context) IsNullableVersion(version int16) bool
- func (f *Context) IsSupportedVersion(version int16) bool
- func (f *Context) IsTaggedVersion(version int16) bool
- func (f *Context) Name() string
- func (f *Context) NonTaggedVersionsSupported() bool
- func (f *Context) OnlyTaggedVersionsSupported() bool
- func (f *Context) Tag() OptionalTag
- type Float64
- type Int16
- type Int32
- type Int64
- type Int8
- type NullableString
- func (s *NullableString) Bytes() []byte
- func (s *NullableString) Clear()
- func (s *NullableString) Equal(that *NullableString) bool
- func (s *NullableString) IsNil() bool
- func (s *NullableString) MarshalJSON() ([]byte, error)
- func (s *NullableString) Release()
- func (s *NullableString) SetValue(value string)
- func (s *NullableString) String() string
- func (s *NullableString) Value() string
- type OptionalTag
- type PrimitiveTypeProcessor
- type RawTaggedField
- func (r *RawTaggedField) Equal(that *RawTaggedField) bool
- func (r *RawTaggedField) MarshalJSON() ([]byte, error)
- func (r *RawTaggedField) Release()
- func (r *RawTaggedField) SetTag(tag uint32)
- func (r *RawTaggedField) SetValue(value []byte)
- func (r *RawTaggedField) String() string
- func (r *RawTaggedField) Tag() uint32
- func (r *RawTaggedField) Value() []byte
- type RecordBatch
- func (b *RecordBatch) Attributes() int16
- func (b *RecordBatch) BaseOffset() int64
- func (b *RecordBatch) BaseSequence() int32
- func (b *RecordBatch) BaseTimestamp() int64
- func (b *RecordBatch) Clear()
- func (b *RecordBatch) Complete()
- func (b *RecordBatch) CompressionType() CompressionType
- func (b *RecordBatch) Equal(that *RecordBatch) bool
- func (b *RecordBatch) IsComplete() bool
- func (b *RecordBatch) IsControlBatch() bool
- func (b *RecordBatch) IsTransactional() bool
- func (b *RecordBatch) LastOffsetDelta() int32
- func (b *RecordBatch) Magic() int8
- func (b *RecordBatch) MarshalJSON() ([]byte, error)
- func (b *RecordBatch) MaxTimestamp() int64
- func (b *RecordBatch) PartitionLeaderEpoch() int32
- func (b *RecordBatch) ProducerEpoch() int16
- func (b *RecordBatch) ProducerId() int64
- func (b *RecordBatch) Read(r *typesbytes.ChunkReader) error
- func (b *RecordBatch) Records() []BatchRecord
- func (b *RecordBatch) Release()
- func (b *RecordBatch) SetAttributes(attributes int16)
- func (b *RecordBatch) SetBaseOffset(baseOffset int64)
- func (b *RecordBatch) SetBaseSequence(baseSequence int32)
- func (b *RecordBatch) SetBaseTimestamp(baseTimestamp int64)
- func (b *RecordBatch) SetLastOffsetDelta(lastOffsetDelta int32)
- func (b *RecordBatch) SetMaxTimestamp(maxTimestamp int64)
- func (b *RecordBatch) SetPartitionLeaderEpoch(partitionLeaderEpoch int32)
- func (b *RecordBatch) SetProducerEpoch(producerEpoch int16)
- func (b *RecordBatch) SetProducerId(producerId int64)
- func (b *RecordBatch) SetRecords(records []BatchRecord)
- func (b *RecordBatch) SizeInBytes() int
- func (b *RecordBatch) String() string
- func (b *RecordBatch) Write(buf *typesbytes.SliceWriter) error
- type RecordBatches
- func (b *RecordBatches) Clear()
- func (b *RecordBatches) ClearAndComplete()
- func (b *RecordBatches) Complete()
- func (b *RecordBatches) Equal(that *RecordBatches) bool
- func (b *RecordBatches) IsNil() bool
- func (b *RecordBatches) Items() []RecordBatch
- func (b *RecordBatches) MarshalJSON() ([]byte, error)
- func (b *RecordBatches) Read(r *typesbytes.ChunkReader) error
- func (b *RecordBatches) Release()
- func (b *RecordBatches) SetItems(items []RecordBatch)
- func (b *RecordBatches) SizeInBytes() int
- func (b *RecordBatches) String() string
- func (b *RecordBatches) Write(buf *typesbytes.SliceWriter) error
- type RecordHeader
- func (h *RecordHeader) Equal(that *RecordHeader) bool
- func (h *RecordHeader) Key() string
- func (h *RecordHeader) MarshalJSON() ([]byte, error)
- func (h *RecordHeader) Read(r *serialization.Reader) error
- func (h *RecordHeader) Release()
- func (h *RecordHeader) SetKey(key string)
- func (h *RecordHeader) SetValue(value []byte)
- func (h *RecordHeader) SizeInBytes() int
- func (h *RecordHeader) String() string
- func (h *RecordHeader) Value() []byte
- func (h *RecordHeader) Write(w *serialization.Writer) error
- type Records
- type String
- type StructType
- type UUID
- type Uint16
- type Uuid
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayMarshalJSON ¶
func IsControlBatch ¶
IsControlBatch returns true if the passed in attributes has the 'isControlBatch' flag set according to https://kafka.apache.org/documentation/#recordbatch
func IsTransactional ¶
IsTransactional returns true if the passed in attributes has the 'isTransactional' flag set according to https://kafka.apache.org/documentation/#recordbatch
func NullableStringSliceEqual ¶
func NullableStringSliceEqual(x, y []NullableString) bool
func PrimitiveTypeSliceEqual ¶
func RawTaggedFieldsEqual ¶
func RawTaggedFieldsEqual(x, y []RawTaggedField) bool
func WriteRawTaggedFields ¶
func WriteRawTaggedFields(buf *typesbytes.SliceWriter, taggedFields []RawTaggedField) error
Types ¶
type Array ¶
type Array[T bool | float64 | int8 | int16 | uint16 | int32 | int64 | NullableString, P PrimitiveTypeProcessor[T]] struct { ElementProcessor P Context }
func (*Array[T, P]) SizeInBytes ¶
SizeInBytes returns the size of data in bytes when it's serialized
func (*Array[T, P]) Write ¶
func (f *Array[T, P]) Write(w *typesbytes.SliceWriter, version int16, data []T) error
type ArrayOfStruct ¶
type ArrayOfStruct[T any, P StructType] struct { Context }
func (*ArrayOfStruct[T, P]) Read ¶
func (f *ArrayOfStruct[T, P]) Read(buf *bytes.Reader, version int16) ([]T, error)
func (*ArrayOfStruct[T, P]) SizeInBytes ¶
func (f *ArrayOfStruct[T, P]) SizeInBytes(version int16, data []T) (int, error)
SizeInBytes returns the size of data in bytes when it's serialized
func (*ArrayOfStruct[T, P]) Write ¶
func (f *ArrayOfStruct[T, P]) Write(w *typesbytes.SliceWriter, version int16, data []T) error
type BatchRecord ¶
type BatchRecord struct {
// contains filtered or unexported fields
}
BatchRecord provides setter/getter methods for kafka records https://kafka.apache.org/documentation/#record
func (*BatchRecord) Equal ¶
func (r *BatchRecord) Equal(that *BatchRecord) bool
func (*BatchRecord) Headers ¶
func (r *BatchRecord) Headers() []RecordHeader
func (*BatchRecord) Key ¶
func (r *BatchRecord) Key() []byte
func (*BatchRecord) MarshalJSON ¶
func (r *BatchRecord) MarshalJSON() ([]byte, error)
func (*BatchRecord) OffsetDelta ¶
func (r *BatchRecord) OffsetDelta() int32
func (*BatchRecord) Read ¶
func (r *BatchRecord) Read(rd *serialization.Reader) error
func (*BatchRecord) Release ¶
func (r *BatchRecord) Release()
func (*BatchRecord) SetHeaders ¶
func (r *BatchRecord) SetHeaders(headers []RecordHeader)
func (*BatchRecord) SetKey ¶
func (r *BatchRecord) SetKey(key []byte)
func (*BatchRecord) SetOffsetDelta ¶
func (r *BatchRecord) SetOffsetDelta(offsetDelta int32)
func (*BatchRecord) SetTimestampDelta ¶
func (r *BatchRecord) SetTimestampDelta(timestampDelta int64)
func (*BatchRecord) SetValue ¶
func (r *BatchRecord) SetValue(value []byte)
func (*BatchRecord) SizeInBytes ¶
func (r *BatchRecord) SizeInBytes() int
func (*BatchRecord) String ¶
func (r *BatchRecord) String() string
func (*BatchRecord) TimestampDelta ¶
func (r *BatchRecord) TimestampDelta() int64
func (*BatchRecord) Value ¶
func (r *BatchRecord) Value() []byte
func (*BatchRecord) Write ¶
func (r *BatchRecord) Write(w *serialization.Writer) error
type Bool ¶
type Bool struct {
Context
}
func (*Bool) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Bool) Write ¶
func (f *Bool) Write(w *typesbytes.SliceWriter, version int16, data bool) error
type Bytes ¶
type Bytes struct {
Context
}
func (*Bytes) SizeInBytes ¶
SizeInBytes returns the size of data in bytes when it's serialized
func (*Bytes) Write ¶
func (f *Bytes) Write(w *typesbytes.SliceWriter, version int16, data []byte) error
type CompressionType ¶
type CompressionType int8
CompressionType represents the compression applied to a record batch.
const ( None CompressionType = 0 Gzip CompressionType = 1 Snappy CompressionType = 2 Lz4 CompressionType = 3 Zstd CompressionType = 4 )
func GetCompressionType ¶
func GetCompressionType(attributes int16) CompressionType
GetCompressionType returns true if the passed in attributes has either 'gzip', 'snappy', 'lz4' or 'zstd' flag set according to https://kafka.apache.org/documentation/#recordbatch
type Context ¶
type Context struct { CustomDefaultValue any SpecName string SpecTag OptionalTag LowestSupportedVersion int16 HighestSupportedVersion int16 LowestSupportedFlexVersion int16 HighestSupportedFlexVersion int16 LowestSupportedNullableVersion int16 HighestSupportedNullableVersion int16 LowestSupportedTaggedVersion int16 HighestSupportedTaggedVersion int16 }
func (*Context) IsFlexibleVersion ¶
func (*Context) IsNullableVersion ¶
func (*Context) IsSupportedVersion ¶
func (*Context) IsTaggedVersion ¶
func (*Context) NonTaggedVersionsSupported ¶
func (*Context) OnlyTaggedVersionsSupported ¶
func (*Context) Tag ¶
func (f *Context) Tag() OptionalTag
type Float64 ¶
type Float64 struct {
Context
}
func (*Float64) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Float64) Write ¶
func (f *Float64) Write(w *typesbytes.SliceWriter, version int16, data float64) error
type Int16 ¶
type Int16 struct {
Context
}
func (*Int16) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Int16) Write ¶
func (f *Int16) Write(w *typesbytes.SliceWriter, version int16, data int16) error
type Int32 ¶
type Int32 struct {
Context
}
func (*Int32) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Int32) Write ¶
func (f *Int32) Write(w *typesbytes.SliceWriter, version int16, data int32) error
type Int64 ¶
type Int64 struct {
Context
}
func (*Int64) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Int64) Write ¶
func (f *Int64) Write(w *typesbytes.SliceWriter, version int16, data int64) error
type Int8 ¶
type Int8 struct {
Context
}
func (*Int8) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Int8) Write ¶
func (f *Int8) Write(w *typesbytes.SliceWriter, version int16, data int8) error
type NullableString ¶
type NullableString struct {
// contains filtered or unexported fields
}
func (*NullableString) Bytes ¶
func (s *NullableString) Bytes() []byte
func (*NullableString) Clear ¶
func (s *NullableString) Clear()
func (*NullableString) Equal ¶
func (s *NullableString) Equal(that *NullableString) bool
func (*NullableString) IsNil ¶
func (s *NullableString) IsNil() bool
func (*NullableString) MarshalJSON ¶
func (s *NullableString) MarshalJSON() ([]byte, error)
func (*NullableString) Release ¶
func (s *NullableString) Release()
func (*NullableString) SetValue ¶
func (s *NullableString) SetValue(value string)
func (*NullableString) String ¶
func (s *NullableString) String() string
func (*NullableString) Value ¶
func (s *NullableString) Value() string
type OptionalTag ¶
type OptionalTag struct {
// contains filtered or unexported fields
}
func Tag ¶
func Tag(tag uint32) OptionalTag
func (*OptionalTag) Get ¶
func (t *OptionalTag) Get() uint32
func (*OptionalTag) IsDefined ¶
func (t *OptionalTag) IsDefined() bool
func (*OptionalTag) Set ¶
func (t *OptionalTag) Set(tag uint32)
type PrimitiveTypeProcessor ¶
type RawTaggedField ¶
type RawTaggedField struct {
// contains filtered or unexported fields
}
RawTaggedField provides setter/getter methods for raw tagged fields
func ReadRawTaggedFields ¶
func ReadRawTaggedFields(buf *bytes.Reader) ([]RawTaggedField, error)
func (*RawTaggedField) Equal ¶
func (r *RawTaggedField) Equal(that *RawTaggedField) bool
func (*RawTaggedField) MarshalJSON ¶
func (r *RawTaggedField) MarshalJSON() ([]byte, error)
func (*RawTaggedField) Release ¶
func (r *RawTaggedField) Release()
func (*RawTaggedField) SetTag ¶
func (r *RawTaggedField) SetTag(tag uint32)
func (*RawTaggedField) SetValue ¶
func (r *RawTaggedField) SetValue(value []byte)
func (*RawTaggedField) String ¶
func (r *RawTaggedField) String() string
func (*RawTaggedField) Tag ¶
func (r *RawTaggedField) Tag() uint32
func (*RawTaggedField) Value ¶
func (r *RawTaggedField) Value() []byte
type RecordBatch ¶
type RecordBatch struct {
// contains filtered or unexported fields
}
RecordBatch provides setter/getter methods for kafka record batch https://kafka.apache.org/documentation/#recordbatch
func (*RecordBatch) Attributes ¶
func (b *RecordBatch) Attributes() int16
func (*RecordBatch) BaseOffset ¶
func (b *RecordBatch) BaseOffset() int64
func (*RecordBatch) BaseSequence ¶
func (b *RecordBatch) BaseSequence() int32
func (*RecordBatch) BaseTimestamp ¶
func (b *RecordBatch) BaseTimestamp() int64
func (*RecordBatch) Clear ¶
func (b *RecordBatch) Clear()
func (*RecordBatch) Complete ¶
func (b *RecordBatch) Complete()
func (*RecordBatch) CompressionType ¶
func (b *RecordBatch) CompressionType() CompressionType
CompressionType returns true if the passed in attributes has either 'gzip', 'snappy', 'lz4' or 'zstd' flag set according to https://kafka.apache.org/documentation/#recordbatch
func (*RecordBatch) Equal ¶
func (b *RecordBatch) Equal(that *RecordBatch) bool
func (*RecordBatch) IsComplete ¶
func (b *RecordBatch) IsComplete() bool
func (*RecordBatch) IsControlBatch ¶
func (b *RecordBatch) IsControlBatch() bool
func (*RecordBatch) IsTransactional ¶
func (b *RecordBatch) IsTransactional() bool
func (*RecordBatch) LastOffsetDelta ¶
func (b *RecordBatch) LastOffsetDelta() int32
func (*RecordBatch) Magic ¶
func (b *RecordBatch) Magic() int8
func (*RecordBatch) MarshalJSON ¶
func (b *RecordBatch) MarshalJSON() ([]byte, error)
func (*RecordBatch) MaxTimestamp ¶
func (b *RecordBatch) MaxTimestamp() int64
func (*RecordBatch) PartitionLeaderEpoch ¶
func (b *RecordBatch) PartitionLeaderEpoch() int32
func (*RecordBatch) ProducerEpoch ¶
func (b *RecordBatch) ProducerEpoch() int16
func (*RecordBatch) ProducerId ¶
func (b *RecordBatch) ProducerId() int64
func (*RecordBatch) Read ¶
func (b *RecordBatch) Read(r *typesbytes.ChunkReader) error
func (*RecordBatch) Records ¶
func (b *RecordBatch) Records() []BatchRecord
func (*RecordBatch) Release ¶
func (b *RecordBatch) Release()
func (*RecordBatch) SetAttributes ¶
func (b *RecordBatch) SetAttributes(attributes int16)
func (*RecordBatch) SetBaseOffset ¶
func (b *RecordBatch) SetBaseOffset(baseOffset int64)
func (*RecordBatch) SetBaseSequence ¶
func (b *RecordBatch) SetBaseSequence(baseSequence int32)
func (*RecordBatch) SetBaseTimestamp ¶
func (b *RecordBatch) SetBaseTimestamp(baseTimestamp int64)
func (*RecordBatch) SetLastOffsetDelta ¶
func (b *RecordBatch) SetLastOffsetDelta(lastOffsetDelta int32)
func (*RecordBatch) SetMaxTimestamp ¶
func (b *RecordBatch) SetMaxTimestamp(maxTimestamp int64)
func (*RecordBatch) SetPartitionLeaderEpoch ¶
func (b *RecordBatch) SetPartitionLeaderEpoch(partitionLeaderEpoch int32)
func (*RecordBatch) SetProducerEpoch ¶
func (b *RecordBatch) SetProducerEpoch(producerEpoch int16)
func (*RecordBatch) SetProducerId ¶
func (b *RecordBatch) SetProducerId(producerId int64)
func (*RecordBatch) SetRecords ¶
func (b *RecordBatch) SetRecords(records []BatchRecord)
func (*RecordBatch) SizeInBytes ¶
func (b *RecordBatch) SizeInBytes() int
SizeInBytes returns the size of this record batch when it's records are not compressed
func (*RecordBatch) String ¶
func (b *RecordBatch) String() string
func (*RecordBatch) Write ¶
func (b *RecordBatch) Write(buf *typesbytes.SliceWriter) error
type RecordBatches ¶
type RecordBatches struct {
// contains filtered or unexported fields
}
RecordBatches manipulates RecordBatch collections
func (*RecordBatches) Clear ¶
func (b *RecordBatches) Clear()
func (*RecordBatches) ClearAndComplete ¶
func (b *RecordBatches) ClearAndComplete()
func (*RecordBatches) Complete ¶
func (b *RecordBatches) Complete()
func (*RecordBatches) Equal ¶
func (b *RecordBatches) Equal(that *RecordBatches) bool
func (*RecordBatches) IsNil ¶
func (b *RecordBatches) IsNil() bool
func (*RecordBatches) Items ¶
func (b *RecordBatches) Items() []RecordBatch
func (*RecordBatches) MarshalJSON ¶
func (b *RecordBatches) MarshalJSON() ([]byte, error)
func (*RecordBatches) Read ¶
func (b *RecordBatches) Read(r *typesbytes.ChunkReader) error
func (*RecordBatches) Release ¶
func (b *RecordBatches) Release()
func (*RecordBatches) SetItems ¶
func (b *RecordBatches) SetItems(items []RecordBatch)
func (*RecordBatches) SizeInBytes ¶
func (b *RecordBatches) SizeInBytes() int
SizeInBytes returns the size of this record batch in bytes when it's serialized
func (*RecordBatches) String ¶
func (b *RecordBatches) String() string
func (*RecordBatches) Write ¶
func (b *RecordBatches) Write(buf *typesbytes.SliceWriter) error
type RecordHeader ¶
type RecordHeader struct {
// contains filtered or unexported fields
}
RecordHeader provides setter/getter methods for kafka record headers https://kafka.apache.org/documentation/#recordheader
func (*RecordHeader) Equal ¶
func (h *RecordHeader) Equal(that *RecordHeader) bool
func (*RecordHeader) Key ¶
func (h *RecordHeader) Key() string
func (*RecordHeader) MarshalJSON ¶
func (h *RecordHeader) MarshalJSON() ([]byte, error)
func (*RecordHeader) Read ¶
func (h *RecordHeader) Read(r *serialization.Reader) error
func (*RecordHeader) Release ¶
func (h *RecordHeader) Release()
func (*RecordHeader) SetKey ¶
func (h *RecordHeader) SetKey(key string)
func (*RecordHeader) SetValue ¶
func (h *RecordHeader) SetValue(value []byte)
func (*RecordHeader) SizeInBytes ¶
func (h *RecordHeader) SizeInBytes() int
func (*RecordHeader) String ¶
func (h *RecordHeader) String() string
func (*RecordHeader) Value ¶
func (h *RecordHeader) Value() []byte
func (*RecordHeader) Write ¶
func (h *RecordHeader) Write(w *serialization.Writer) error
type Records ¶
type Records struct {
Context
}
func (*Records) SizeInBytes ¶
func (f *Records) SizeInBytes(version int16, data *RecordBatches) (int, error)
func (*Records) Write ¶
func (f *Records) Write(buf *typesbytes.SliceWriter, version int16, data *RecordBatches) error
type String ¶
type String struct {
Context
}
func (*String) SizeInBytes ¶
func (s *String) SizeInBytes(version int16, data NullableString) (int, error)
SizeInBytes returns the size of data in bytes when it's serialized
func (*String) Write ¶
func (s *String) Write(w *typesbytes.SliceWriter, version int16, data NullableString) error
type StructType ¶
type Uint16 ¶
type Uint16 struct {
Context
}
func (*Uint16) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Uint16) Write ¶
func (f *Uint16) Write(w *typesbytes.SliceWriter, version int16, data uint16) error
type Uuid ¶
type Uuid struct {
Context
}
func (*Uuid) SizeInBytes ¶
SizeInBytes returns the size of this field in bytes when it's serialized
func (*Uuid) Write ¶
func (f *Uuid) Write(w *typesbytes.SliceWriter, version int16, data UUID) error