Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ReqResp a where
- MetadataRR :: MonadIO m => MetadataRequest -> ReqResp (m MetadataResponse)
- ProduceRR :: MonadIO m => ProduceRequest -> ReqResp (m ProduceResponse)
- FetchRR :: MonadIO m => FetchRequest -> ReqResp (m FetchResponse)
- OffsetRR :: MonadIO m => OffsetRequest -> ReqResp (m OffsetResponse)
- doRequest' :: (Deserializable a, MonadIO m) => CorrelationId -> Handle -> Request -> m (Either String a)
- doRequest :: MonadIO m => ClientId -> CorrelationId -> Handle -> ReqResp (m a) -> m (Either String a)
- class Serializable a where
- class Deserializable a where
- newtype GroupCoordinatorResponse = GroupCoordinatorResp (KafkaError, Broker)
- newtype ApiKey = ApiKey Int16
- newtype ApiVersion = ApiVersion Int16
- newtype CorrelationId = CorrelationId Int32
- newtype ClientId = ClientId KafkaString
- data RequestMessage
- newtype MetadataRequest = MetadataReq [TopicName]
- newtype TopicName = TName {}
- newtype KafkaBytes = KBytes {}
- newtype KafkaString = KString {}
- newtype ProduceResponse = ProduceResp {
- _produceResponseFields :: [(TopicName, [(Partition, KafkaError, Offset)])]
- newtype OffsetResponse = OffsetResp {
- _offsetResponseFields :: [(TopicName, [PartitionOffsets])]
- newtype PartitionOffsets = PartitionOffsets {
- _partitionOffsetsFields :: (Partition, KafkaError, [Offset])
- newtype FetchResponse = FetchResp {
- _fetchResponseFields :: [(TopicName, [(Partition, KafkaError, Offset, MessageSet)])]
- newtype MetadataResponse = MetadataResp {
- _metadataResponseFields :: ([Broker], [TopicMetadata])
- newtype Broker = Broker {
- _brokerFields :: (NodeId, Host, Port)
- newtype NodeId = NodeId {}
- newtype Host = Host {}
- newtype Port = Port {}
- newtype TopicMetadata = TopicMetadata {}
- newtype PartitionMetadata = PartitionMetadata {}
- newtype Leader = Leader {}
- newtype Replicas = Replicas [Int32]
- newtype Isr = Isr [Int32]
- newtype OffsetCommitResponse = OffsetCommitResp [(TopicName, [(Partition, KafkaError)])]
- newtype OffsetFetchResponse = OffsetFetchResp [(TopicName, [(Partition, Offset, Metadata, KafkaError)])]
- newtype OffsetRequest = OffsetReq (ReplicaId, [(TopicName, [(Partition, Time, MaxNumberOfOffsets)])])
- newtype Time = Time {}
- newtype MaxNumberOfOffsets = MaxNumberOfOffsets Int32
- newtype FetchRequest = FetchReq (ReplicaId, MaxWaitTime, MinBytes, [(TopicName, [(Partition, Offset, MaxBytes)])])
- newtype ReplicaId = ReplicaId Int32
- newtype MaxWaitTime = MaxWaitTime Int32
- newtype MinBytes = MinBytes Int32
- newtype MaxBytes = MaxBytes Int32
- newtype ProduceRequest = ProduceReq (RequiredAcks, Timeout, [(TopicName, [(Partition, MessageSet)])])
- newtype RequiredAcks = RequiredAcks Int16
- newtype Timeout = Timeout Int32
- newtype Partition = Partition Int32
- data MessageSet = MessageSet {}
- data MessageSetMember = MessageSetMember {}
- newtype Offset = Offset Int64
- newtype Message = Message {
- _messageFields :: (Crc, MagicByte, Attributes, Key, Value)
- data CompressionCodec
- newtype Crc = Crc Int32
- newtype MagicByte = MagicByte Int8
- data Attributes = Attributes {}
- newtype Key = Key {}
- newtype Value = Value {}
- data ResponseMessage
- newtype GroupCoordinatorRequest = GroupCoordinatorReq ConsumerGroup
- newtype OffsetCommitRequest = OffsetCommitReq (ConsumerGroup, [(TopicName, [(Partition, Offset, Time, Metadata)])])
- newtype OffsetFetchRequest = OffsetFetchReq (ConsumerGroup, [(TopicName, [Partition])])
- newtype ConsumerGroup = ConsumerGroup KafkaString
- newtype Metadata = Metadata KafkaString
- errorKafka :: KafkaError -> Int16
- data KafkaError
- = NoError
- | Unknown
- | OffsetOutOfRange
- | InvalidMessage
- | UnknownTopicOrPartition
- | InvalidMessageSize
- | LeaderNotAvailable
- | NotLeaderForPartition
- | RequestTimedOut
- | BrokerNotAvailable
- | ReplicaNotAvailable
- | MessageSizeTooLarge
- | StaleControllerEpochCode
- | OffsetMetadataTooLargeCode
- | OffsetsLoadInProgressCode
- | ConsumerCoordinatorNotAvailableCode
- | NotCoordinatorForConsumerCode
- newtype Request = Request (CorrelationId, ClientId, RequestMessage)
- requestBytes :: Request -> ByteString
- apiVersion :: RequestMessage -> ApiVersion
- apiKey :: RequestMessage -> ApiKey
- compressionCodecFromValue :: Int8 -> Maybe CompressionCodec
- tName :: Iso' TopicName KafkaString
- kafkaByteString :: Iso' KafkaBytes ByteString
- kString :: Iso' KafkaString ByteString
- produceResponseFields :: Iso' ProduceResponse [(TopicName, [(Partition, KafkaError, Offset)])]
- offsetResponseFields :: Iso' OffsetResponse [(TopicName, [PartitionOffsets])]
- partitionOffsetsFields :: Iso' PartitionOffsets (Partition, KafkaError, [Offset])
- fetchResponseFields :: Iso' FetchResponse [(TopicName, [(Partition, KafkaError, Offset, MessageSet)])]
- metadataResponseFields :: Iso' MetadataResponse ([Broker], [TopicMetadata])
- brokerFields :: Iso' Broker (NodeId, Host, Port)
- nodeId :: Iso' NodeId Int32
- hostKString :: Iso' Host KafkaString
- portInt :: Iso' Port Int32
- topicMetadataFields :: Iso' TopicMetadata (KafkaError, TopicName, [PartitionMetadata])
- partitionMetadataFields :: Iso' PartitionMetadata (KafkaError, Partition, Leader, Replicas, Isr)
- leaderId :: Iso' Leader (Maybe Int32)
- timeInt :: Iso' Time Int64
- messageSetMembers :: Lens' MessageSet [MessageSetMember]
- codec :: Lens' MessageSet CompressionCodec
- setOffset :: Lens' MessageSetMember Offset
- setMessage :: Lens' MessageSetMember Message
- messageFields :: Iso' Message (Crc, MagicByte, Attributes, Key, Value)
- keyBytes :: Iso' Key (Maybe KafkaBytes)
- valueBytes :: Iso' Value (Maybe KafkaBytes)
- _GroupCoordinatorResponse :: Prism' ResponseMessage GroupCoordinatorResponse
- _OffsetFetchResponse :: Prism' ResponseMessage OffsetFetchResponse
- _OffsetCommitResponse :: Prism' ResponseMessage OffsetCommitResponse
- _OffsetResponse :: Prism' ResponseMessage OffsetResponse
- _FetchResponse :: Prism' ResponseMessage FetchResponse
- _ProduceResponse :: Prism' ResponseMessage ProduceResponse
- _MetadataResponse :: Prism' ResponseMessage MetadataResponse
- keyed :: (Field1 a a b b, Choice p, Applicative f, Eq b) => b -> Optic' p f a a
- metadataResponseBrokers :: Lens' MetadataResponse [Broker]
- topicsMetadata :: Lens' MetadataResponse [TopicMetadata]
- topicMetadataKafkaError :: Lens' TopicMetadata KafkaError
- topicMetadataName :: Lens' TopicMetadata TopicName
- partitionsMetadata :: Lens' TopicMetadata [PartitionMetadata]
- partitionId :: Lens' PartitionMetadata Partition
- partitionMetadataLeader :: Lens' PartitionMetadata Leader
- brokerNode :: Lens' Broker NodeId
- brokerHost :: Lens' Broker Host
- brokerPort :: Lens' Broker Port
- fetchResponseMessages :: Fold FetchResponse MessageSet
- fetchResponseByTopic :: TopicName -> Fold FetchResponse (Partition, KafkaError, Offset, MessageSet)
- messageSetByPartition :: Partition -> Fold (Partition, KafkaError, Offset, MessageSet) MessageSetMember
- fetchResponseMessageMembers :: Fold FetchResponse MessageSetMember
- messageKey :: Lens' Message Key
- messageKeyBytes :: Fold Message ByteString
- messageValue :: Lens' Message Value
- payload :: Fold Message ByteString
- offsetResponseOffset :: Partition -> Fold OffsetResponse Offset
- messageSet :: Partition -> TopicName -> Fold FetchResponse MessageSetMember
- nextOffset :: Lens' MessageSetMember Offset
- findPartitionMetadata :: Applicative f => TopicName -> LensLike' f TopicMetadata [PartitionMetadata]
- findPartition :: Partition -> Prism' PartitionMetadata PartitionMetadata
- hostString :: Lens' Host String
- portId :: IndexPreservingGetter Port PortID
Documentation
MetadataRR :: MonadIO m => MetadataRequest -> ReqResp (m MetadataResponse) | |
ProduceRR :: MonadIO m => ProduceRequest -> ReqResp (m ProduceResponse) | |
FetchRR :: MonadIO m => FetchRequest -> ReqResp (m FetchResponse) | |
OffsetRR :: MonadIO m => OffsetRequest -> ReqResp (m OffsetResponse) |
doRequest' :: (Deserializable a, MonadIO m) => CorrelationId -> Handle -> Request -> m (Either String a) Source #
doRequest :: MonadIO m => ClientId -> CorrelationId -> Handle -> ReqResp (m a) -> m (Either String a) Source #
class Serializable a where Source #
class Deserializable a where Source #
deserialize :: Get a Source #
newtype GroupCoordinatorResponse Source #
newtype ApiVersion Source #
newtype CorrelationId Source #
data RequestMessage Source #
newtype MetadataRequest Source #
newtype KafkaBytes Source #
newtype KafkaString Source #
newtype ProduceResponse Source #
ProduceResp | |
|
newtype OffsetResponse Source #
newtype PartitionOffsets Source #
newtype FetchResponse Source #
FetchResp | |
|
newtype MetadataResponse Source #
Broker | |
|
newtype TopicMetadata Source #
newtype PartitionMetadata Source #
newtype OffsetCommitResponse Source #
OffsetCommitResp [(TopicName, [(Partition, KafkaError)])] |
newtype OffsetFetchResponse Source #
OffsetFetchResp [(TopicName, [(Partition, Offset, Metadata, KafkaError)])] |
newtype OffsetRequest Source #
newtype MaxNumberOfOffsets Source #
newtype FetchRequest Source #
newtype MaxWaitTime Source #
newtype ProduceRequest Source #
ProduceReq (RequiredAcks, Timeout, [(TopicName, [(Partition, MessageSet)])]) |
newtype RequiredAcks Source #
data MessageSet Source #
data MessageSetMember Source #
Message | |
|
data CompressionCodec Source #
data Attributes Source #
data ResponseMessage Source #
newtype GroupCoordinatorRequest Source #
newtype OffsetCommitRequest Source #
OffsetCommitReq (ConsumerGroup, [(TopicName, [(Partition, Offset, Time, Metadata)])]) |
newtype OffsetFetchRequest Source #
OffsetFetchReq (ConsumerGroup, [(TopicName, [Partition])]) |
newtype ConsumerGroup Source #
errorKafka :: KafkaError -> Int16 Source #
data KafkaError Source #
NoError |
|
Unknown |
|
OffsetOutOfRange |
|
InvalidMessage |
|
UnknownTopicOrPartition |
|
InvalidMessageSize |
|
LeaderNotAvailable |
|
NotLeaderForPartition |
|
RequestTimedOut |
|
BrokerNotAvailable |
|
ReplicaNotAvailable |
|
MessageSizeTooLarge |
|
StaleControllerEpochCode |
|
OffsetMetadataTooLargeCode |
|
OffsetsLoadInProgressCode |
|
ConsumerCoordinatorNotAvailableCode |
|
NotCoordinatorForConsumerCode |
|
requestBytes :: Request -> ByteString Source #
apiKey :: RequestMessage -> ApiKey Source #
Generated lenses
produceResponseFields :: Iso' ProduceResponse [(TopicName, [(Partition, KafkaError, Offset)])] Source #
fetchResponseFields :: Iso' FetchResponse [(TopicName, [(Partition, KafkaError, Offset, MessageSet)])] Source #
partitionMetadataFields :: Iso' PartitionMetadata (KafkaError, Partition, Leader, Replicas, Isr) Source #
messageFields :: Iso' Message (Crc, MagicByte, Attributes, Key, Value) Source #
valueBytes :: Iso' Value (Maybe KafkaBytes) Source #
Composed lenses
fetchResponseByTopic :: TopicName -> Fold FetchResponse (Partition, KafkaError, Offset, MessageSet) Source #
messageSetByPartition :: Partition -> Fold (Partition, KafkaError, Offset, MessageSet) MessageSetMember Source #
findPartitionMetadata :: Applicative f => TopicName -> LensLike' f TopicMetadata [PartitionMetadata] Source #