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

This protocol is used to parse Metadata responses.

Each Kayrock.Metadata version (V0-V9) implements this protocol to transform the Kayrock response into a ClusterMetadata struct.

The Any fallback is retained only for forward compatibility with unknown future versions beyond what Kayrock currently supports.

Summary

Types

t()

All the types that implement this protocol.

Functions

Parses a Metadata response into ClusterMetadata.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

Link to this function

parse_response(response)

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

Parses a Metadata response into ClusterMetadata.

Returns

  • {:ok, cluster_metadata} - Successfully parsed metadata
  • {:error, reason} - Parse error or Kafka error