mu-avro-0.2.0.0: 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 .proto file and generates: * A Schema with all the message types, using the name given as first argument. * A Service declaration for each service in the file, where the name is obtained by applying the function given as second argument to the name 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.