View Source KafkaEx.Protocol.Kayrock.OffsetFetch.RequestHelpers (kafka_ex v1.0.0-rc.1)

Shared helper functions for building OffsetFetch requests across all versions.

This module reduces code duplication while maintaining type safety through protocol dispatch for each version-specific struct.

Summary

Functions

Builds partition index list for a topic.

Builds the topics structure for OffsetFetch requests.

Extracts common fields from request options.

Types

@type partition_data() :: %{partition_num: non_neg_integer()}
@type partition_output() :: %{partition: non_neg_integer()}
@type topic_data() :: {String.t(), [partition_data()]}
@type topic_output() :: %{topic: String.t(), partitions: [partition_output()]}

Functions

Link to this function

build_partition_indexes(partitions)

View Source
@spec build_partition_indexes([partition_data()]) :: [non_neg_integer()]

Builds partition index list for a topic.

@spec build_topics(Keyword.t()) :: [topic_output()]

Builds the topics structure for OffsetFetch requests.

Link to this function

extract_common_fields(opts)

View Source
@spec extract_common_fields(Keyword.t()) :: %{group_id: String.t()}

Extracts common fields from request options.