Documentation
¶
Overview ¶
Package kversion specifies max versions for Kafka request keys.
Kafka technically has internal broker versions that bump multiple times per release. This package only defines releases and tip.
Index ¶
- type Versions
- func FromApiVersionsResponse(r *kmsg.ApiVersionsResponse) Versions
- func Stable() Versions
- func Tip() Versions
- func V0_10_0() Versions
- func V0_10_1() Versions
- func V0_10_2() Versions
- func V0_11_0() Versions
- func V0_8_0() Versions
- func V0_8_1() Versions
- func V0_8_2() Versions
- func V0_9_0() Versions
- func V1_0_0() Versions
- func V1_1_0() Versions
- func V2_0_0() Versions
- func V2_1_0() Versions
- func V2_2_0() Versions
- func V2_3_0() Versions
- func V2_4_0() Versions
- func V2_5_0() Versions
- func V2_6_0() Versions
- func V2_7_0() Versions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Versions ¶
type Versions struct {
// contains filtered or unexported fields
}
Versions is a list of versions, with each item corresponding to a Kafka key and each item's value corresponding to the max version supported.
Minimum versions are not currently tracked because all keys have a minimum version of zero. The internals of a Versions may change in the future to support minimum versions; the outward facing API of Versions should not change to support this.
As well, supported features may be added in the future.
func FromApiVersionsResponse ¶ added in v0.6.2
func FromApiVersionsResponse(r *kmsg.ApiVersionsResponse) Versions
FromApiVersionsResponse returns a Versions from a kmsg.ApiVersionsResponse.
func Stable ¶
func Stable() Versions
Stable is a shortcut for the latest _released_ Kafka versions.
This is the default version used in kgo to avoid breaking tip changes.
func Tip ¶
func Tip() Versions
Tip is the latest defined Kafka key versions; this may be slightly out of date.
func (Versions) HasKey ¶ added in v0.6.2
HasKey returns true if the versions contains the given key.
func (Versions) LookupMaxKeyVersion ¶ added in v0.6.2
LookupMaxKeyVersion returns the version for the given key and whether the key exists. If the key does not exist, this returns (-1, false).
func (*Versions) SetMaxKeyVersion ¶ added in v0.6.2
SetMaxKeyVersion sets the max version for the given key.
Setting a version to -1 unsets the key.
Versions are backed by a slice; if the slice is not long enough, it is extended to fit the key.