protocol

package
v0.0.0-...-9485a9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadProtocolSpec

func LoadProtocolSpec(kafkaProtocolSpec fs.FS) (map[string]*MessageSpec, error)

func VersionRange

func VersionRange(versions string) (int16, int16, error)

VersionRange parses the provided version string and returns a tuple that corresponds to the version range described in version. e.g. for "0-2" returns (0,2)

for "3+" returns (3,  MaxInt16)

Types

type MessageFieldSpec

type MessageFieldSpec struct {
	Name             string             `json:"name"`
	Type             string             `json:"type"`
	MapKey           bool               `json:"mapKey,omitempty"`
	Default          any                `json:"default,omitempty"`
	EntityType       string             `json:"entityType,omitempty"`
	ZeroCopy         *bool              `json:"zeroCopy,omitempty"`
	Versions         string             `json:"versions"`
	FlexibleVersions string             `json:"flexibleVersions,omitempty"`
	NullableVersions string             `json:"nullableVersions,omitempty"`
	TaggedVersions   string             `json:"taggedVersions,omitempty"`
	Ignorable        bool               `json:"ignorable,omitempty"`
	Tag              *uint32            `json:"tag,omitempty"`
	About            string             `json:"about"`
	Fields           []MessageFieldSpec `json:"fields,omitempty"`
}

type MessageSpec

type MessageSpec struct {
	APIKey           int                `json:"apiKey"`
	Type             string             `json:"type"`
	Listeners        []string           `json:"listeners,omitempty"`
	Name             string             `json:"name"`
	ValidVersions    string             `json:"validVersions"`
	FlexibleVersions string             `json:"flexibleVersions"`
	Fields           []MessageFieldSpec `json:"fields"`
	CommonStructs    []StructSpec       `json:"commonStructs,omitempty"`
}

type StructSpec

type StructSpec struct {
	Name     string             `json:"name"`
	Versions string             `json:"versions"`
	Fields   []MessageFieldSpec `json:"fields"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL