View Source KafkaEx.Protocol.Kayrock.Metadata.ResponseHelpers (kafka_ex v1.0.0-rc.1)

Helper functions for parsing Metadata responses across different protocol versions.

Summary

Functions

Checks if the metadata response contains any errors.

Parses broker list from Kayrock response.

Parses partition metadata list from Kayrock response.

Parses topic metadata list from Kayrock response.

Converts a Kayrock Metadata response to ClusterMetadata.

Functions

Link to this function

check_for_errors(response)

View Source
@spec check_for_errors(map()) :: :ok | {:error, term()}

Checks if the metadata response contains any errors.

Link to this function

parse_brokers(kayrock_brokers)

View Source
@spec parse_brokers([map()]) :: %{
  required(non_neg_integer()) => KafkaEx.Cluster.Broker.t()
}

Parses broker list from Kayrock response.

Link to this function

parse_partitions(kayrock_partitions)

View Source
@spec parse_partitions([map()]) :: [KafkaEx.Cluster.PartitionInfo.t()]

Parses partition metadata list from Kayrock response.

Link to this function

parse_topics(kayrock_topics)

View Source
@spec parse_topics([map()]) :: %{required(String.t()) => KafkaEx.Cluster.Topic.t()}

Parses topic metadata list from Kayrock response.

Link to this function

to_cluster_metadata(response, opts \\ [])

View Source
@spec to_cluster_metadata(map(), Keyword.t()) ::
  {:ok, KafkaEx.Cluster.ClusterMetadata.t()} | {:error, term()}

Converts a Kayrock Metadata response to ClusterMetadata.