mu-avro-0.4.0.4: Avro serialization support for Mu microservices
Safe HaskellNone
LanguageHaskell2010

Mu.Quasi.Avro

Description

This module turns schema definitions written in Avro IDL into Mu Schemas. We provide versions for writing the IDL inline (avro) and import it from a file (avroFile).

Note: as of now, only the JSON-based IDL format is supported, not the Java-like one.

Synopsis

Service generation from .avdl files

avdl :: String -> String -> FilePath -> FilePath -> Q [Dec] Source #

Reads a .avdl file and generates: * A Schema with all the record types, using the name given as first argument. * A Service declaration containing all the methods defined in the file.

Quasi-quoters for .avsc files

avro :: QuasiQuoter Source #

Imports an avro definition written in-line as a Schema.

avroFile :: QuasiQuoter Source #

Imports an avro definition from a file as a Schema.

Only for internal use

schemaFromAvroType :: Schema -> Q Type Source #

Turns a schema from Avro into a Template Haskell Type.