View Source KafkaEx.Protocol.KayrockProtocol (kafka_ex v1.0.0-rc.1)
This module handles Kayrock request & response handling & parsing. Once Kafka Ex v1.0 is released, this module will be renamed to KayrockProtocol and will become a separated package.
Summary
Functions
Returns the integer API key for a given API name atom (e.g. :metadata → 3).
Converts an error atom to its integer Kafka error code.
Builds kayrock request based on type, api version and opts
Converts an integer Kafka error code to its atom representation.
Returns the maximum protocol version that Kayrock supports for the given API.
Parses response based on request type and response
Extracts operation name and API version from a Kayrock request struct.
Returns the response deserializer function for a given request struct.
Serializes a Kayrock request struct to wire-format iodata.
Functions
@spec api_key(atom()) :: non_neg_integer()
Returns the integer API key for a given API name atom (e.g. :metadata → 3).
Converts an error atom to its integer Kafka error code.
Builds kayrock request based on type, api version and opts
Converts an integer Kafka error code to its atom representation.
@spec max_supported_version(atom()) :: non_neg_integer()
Returns the maximum protocol version that Kayrock supports for the given API.
Parses response based on request type and response
@spec request_info(struct()) :: {atom(), non_neg_integer()}
Extracts operation name and API version from a Kayrock request struct.
Returns {operation, api_version} tuple where:
operationis an atom like:metadata,:produce,:fetch, etc.api_versionis an integer like 0, 1, 2, etc.
Returns the response deserializer function for a given request struct.
Serializes a Kayrock request struct to wire-format iodata.