Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data DecodeError
- decode :: forall a m. (MonadIO m, HasAvroSchema a, FromAvro a) => SchemaRegistry -> ByteString -> m (Either DecodeError a)
- decodeWithSchema :: forall a m. (MonadIO m, FromAvro a) => SchemaRegistry -> Schema -> ByteString -> m (Either DecodeError a)
- extractSchemaId :: ByteString -> Maybe (SchemaId, ByteString)
Documentation
data DecodeError Source #
DecodeRegistryError SchemaRegistryError | |
BadPayloadNoSchemaId | |
DecodeError Schema String | |
IncompatibleSchema Schema String |
Instances
Eq DecodeError Source # | |
Defined in Kafka.Avro.Decode (==) :: DecodeError -> DecodeError -> Bool # (/=) :: DecodeError -> DecodeError -> Bool # | |
Show DecodeError Source # | |
Defined in Kafka.Avro.Decode showsPrec :: Int -> DecodeError -> ShowS # show :: DecodeError -> String # showList :: [DecodeError] -> ShowS # |
decode :: forall a m. (MonadIO m, HasAvroSchema a, FromAvro a) => SchemaRegistry -> ByteString -> m (Either DecodeError a) Source #
Decodes a provided Avro-encoded value. The serialised value is expected to be in a "confluent-compatible" format where the "real" value bytestring is prepended with extra 5 bytes: a "magic" byte and 4 bytes representing the schema ID.
decodeWithSchema :: forall a m. (MonadIO m, FromAvro a) => SchemaRegistry -> Schema -> ByteString -> m (Either DecodeError a) Source #
extractSchemaId :: ByteString -> Maybe (SchemaId, ByteString) Source #