| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Kafka.Avro.SchemaRegistry
Synopsis
- schemaRegistry :: MonadIO m => String -> m SchemaRegistry
- loadSchema :: MonadIO m => SchemaRegistry -> SchemaId -> m (Either SchemaRegistryError Schema)
- sendSchema :: MonadIO m => SchemaRegistry -> Subject -> Schema -> m (Either SchemaRegistryError SchemaId)
- schemaRegistry_ :: MonadIO m => Maybe Auth -> String -> m SchemaRegistry
- schemaRegistryWithHeaders :: MonadIO m => Maybe Auth -> [Header] -> String -> m SchemaRegistry
- loadSubjectSchema :: MonadIO m => SchemaRegistry -> Subject -> Version -> m (Either SchemaRegistryError Schema)
- getGlobalConfig :: MonadIO m => SchemaRegistry -> m (Either SchemaRegistryError Compatibility)
- getSubjectConfig :: MonadIO m => SchemaRegistry -> Subject -> m (Either SchemaRegistryError Compatibility)
- getVersions :: MonadIO m => SchemaRegistry -> Subject -> m (Either SchemaRegistryError [Version])
- isCompatible :: MonadIO m => SchemaRegistry -> Subject -> Version -> Schema -> m (Either SchemaRegistryError Bool)
- getSubjects :: MonadIO m => SchemaRegistry -> m (Either SchemaRegistryError [Subject])
- defaultSchemaRegistryConfig :: SchemaRegistryConfig
- cfgAuth :: Maybe Auth -> SchemaRegistryConfig -> SchemaRegistryConfig
- cfgHeaders :: [Header] -> SchemaRegistryConfig -> SchemaRegistryConfig
- cfgAutoRegisterSchemas :: Bool -> SchemaRegistryConfig -> SchemaRegistryConfig
- newtype SchemaId = SchemaId {
- unSchemaId :: Int32
- newtype Subject = Subject {}
- data SchemaRegistryConfig
- data SchemaRegistry
- data SchemaRegistryError
- data Schema where
- Null
- Boolean
- Int { }
- Long { }
- Float
- Double
- Bytes { }
- String { }
- Array { }
- Map { }
- NamedType TypeName
- Record { }
- Enum { }
- Union { }
- Fixed {
- name :: TypeName
- aliases :: [TypeName]
- size :: Int
- logicalTypeF :: Maybe LogicalTypeFixed
- pattern String' :: Schema
- pattern Bytes' :: Schema
- pattern Long' :: Schema
- pattern Int' :: Schema
- data Compatibility
- newtype Version = Version {}
Documentation
schemaRegistry :: MonadIO m => String -> m SchemaRegistry Source #
loadSchema :: MonadIO m => SchemaRegistry -> SchemaId -> m (Either SchemaRegistryError Schema) Source #
sendSchema :: MonadIO m => SchemaRegistry -> Subject -> Schema -> m (Either SchemaRegistryError SchemaId) Source #
Get the schema ID.
If the SchemaRegistry is configured to auto-register schemas,
this posts the schema to the schema registry server.
Otherwise, this searches for a compatible schema and returns a SchemaRegistryNoCompatibleSchemaFound
if none is found.
schemaRegistry_ :: MonadIO m => Maybe Auth -> String -> m SchemaRegistry Source #
schemaRegistryWithHeaders :: MonadIO m => Maybe Auth -> [Header] -> String -> m SchemaRegistry Source #
loadSubjectSchema :: MonadIO m => SchemaRegistry -> Subject -> Version -> m (Either SchemaRegistryError Schema) Source #
getGlobalConfig :: MonadIO m => SchemaRegistry -> m (Either SchemaRegistryError Compatibility) Source #
getSubjectConfig :: MonadIO m => SchemaRegistry -> Subject -> m (Either SchemaRegistryError Compatibility) Source #
getVersions :: MonadIO m => SchemaRegistry -> Subject -> m (Either SchemaRegistryError [Version]) Source #
isCompatible :: MonadIO m => SchemaRegistry -> Subject -> Version -> Schema -> m (Either SchemaRegistryError Bool) Source #
getSubjects :: MonadIO m => SchemaRegistry -> m (Either SchemaRegistryError [Subject]) Source #
cfgAuth :: Maybe Auth -> SchemaRegistryConfig -> SchemaRegistryConfig Source #
Add authentication options
cfgHeaders :: [Header] -> SchemaRegistryConfig -> SchemaRegistryConfig Source #
Add extra headers
cfgAutoRegisterSchemas :: Bool -> SchemaRegistryConfig -> SchemaRegistryConfig Source #
Set whether to auto-publish schemas
If set to False, encoding will fail if there is no compatible schema
in the schema registy.
This is equivalent to the confluent 'auto.register.schemas' option.
Constructors
| SchemaId | |
Fields
| |
Instances
| IsString Subject Source # | |
Defined in Kafka.Avro.SchemaRegistry Methods fromString :: String -> Subject # | |
| Generic Subject Source # | |
| Show Subject Source # | |
| Eq Subject Source # | |
| Ord Subject Source # | |
Defined in Kafka.Avro.SchemaRegistry | |
| Hashable Subject Source # | |
Defined in Kafka.Avro.SchemaRegistry | |
| type Rep Subject Source # | |
Defined in Kafka.Avro.SchemaRegistry | |
data SchemaRegistryConfig Source #
data SchemaRegistry Source #
data SchemaRegistryError Source #
Constructors
Instances
| Show SchemaRegistryError Source # | |
Defined in Kafka.Avro.SchemaRegistry Methods showsPrec :: Int -> SchemaRegistryError -> ShowS # show :: SchemaRegistryError -> String # showList :: [SchemaRegistryError] -> ShowS # | |
| Eq SchemaRegistryError Source # | |
Defined in Kafka.Avro.SchemaRegistry Methods (==) :: SchemaRegistryError -> SchemaRegistryError -> Bool # (/=) :: SchemaRegistryError -> SchemaRegistryError -> Bool # | |
N.B. It is possible to create a Haskell value (of Schema type) that is
not a valid Avro schema by violating one of the above or one of the
conditions called out in validateSchema.
Constructors
| Null | |
| Boolean | |
| Int | |
Fields | |
| Long | |
Fields | |
| Float | |
| Double | |
| Bytes | |
Fields | |
| String | |
Fields | |
| Array | |
| Map | |
| NamedType TypeName | |
| Record | |
| Enum | |
| Union | |
| Fixed | |
Fields
| |
Bundled Patterns
| pattern String' :: Schema | |
| pattern Bytes' :: Schema | |
| pattern Long' :: Schema | |
| pattern Int' :: Schema |
Instances
data Compatibility Source #
Instances
| FromJSON Compatibility Source # | |
Defined in Kafka.Avro.SchemaRegistry Methods parseJSON :: Value -> Parser Compatibility # parseJSONList :: Value -> Parser [Compatibility] # | |
| Show Compatibility Source # | |
Defined in Kafka.Avro.SchemaRegistry Methods showsPrec :: Int -> Compatibility -> ShowS # show :: Compatibility -> String # showList :: [Compatibility] -> ShowS # | |
| Eq Compatibility Source # | |
Defined in Kafka.Avro.SchemaRegistry Methods (==) :: Compatibility -> Compatibility -> Bool # (/=) :: Compatibility -> Compatibility -> Bool # | |
| Ord Compatibility Source # | |
Defined in Kafka.Avro.SchemaRegistry Methods compare :: Compatibility -> Compatibility -> Ordering # (<) :: Compatibility -> Compatibility -> Bool # (<=) :: Compatibility -> Compatibility -> Bool # (>) :: Compatibility -> Compatibility -> Bool # (>=) :: Compatibility -> Compatibility -> Bool # max :: Compatibility -> Compatibility -> Compatibility # min :: Compatibility -> Compatibility -> Compatibility # | |