language-avro: Language definition and parser for AVRO files.

[ apache, library, network ] [ Propose Tags ]

Parser for the AVRO language specification, see README.md for more details.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.3.1, 0.1.4.0
Dependencies avro, base (>=4.12 && <5), filepath, megaparsec, text, vector [details]
License Apache-2.0
Copyright Copyright © 2019-2020 <http://47deg.com 47 Degrees>
Author Flavio Corpa
Maintainer flavio.corpa@47deg.com
Category Network
Home page https://github.com/kutyel/avro-parser-haskell#readme
Uploaded by FlavioCorpa at 2020-02-04T15:33:15Z
Distributions LTSHaskell:0.1.4.0
Reverse Dependencies 1 direct, 4 indirect [details]
Downloads 1759 total (24 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for language-avro-0.1.0.0

[back to package description]

avro-parser-haskell

Actions Status Hackage ormolu

Language definition and parser for AVRO (.avdl) files.

Example

#! /usr/bin/env runhaskell

module Main where

import Language.Avro.Parser (readWithImports)

main :: IO ()
main = readWithImports "test" "PeopleService.avdl"
-- λ>
-- Right
--   (Protocol {
--     ns = Just (Namespace ["example","seed","server","protocol","avro"]),
--     pname = "PeopleService", imports = [IdlImport "People.avdl"],
--     types = [
--       Record {
--         name = "Person",
--         aliases = [],
--         doc = Nothing,
--         order = Nothing,
--         fields = [
--           Field {
--             fldName = "name",
--             fldAliases = [],
--             fldDoc = Nothing,
--             fldOrder = Nothing,
--             fldType = String,
--             fldDefault = Nothing
--           },
--           Field {
--             fldName = "age",
--             fldAliases = [],
--             fldDoc = Nothing,
--             fldOrder = Nothing,
--             fldType = Int,
--             fldDefault = Nothing
--           }
--         ]
--       },
--       Record {
--         name = "NotFoundError",
--         aliases = [],
--         doc = Nothing,
--         order = Nothing,
--         fields = [
--           Field {
--             fldName = "message",
--             fldAliases = [],
--             fldDoc = Nothing,
--             fldOrder = Nothing,
--             fldType = String,
--             fldDefault = Nothing
--           }
--         ]
--       },
--       Record {
--         name = "DuplicatedPersonError",
--         aliases = [],
--         doc = Nothing,
--         order = Nothing,
--         fields = [
--           Field {
--             fldName = "message",
--             fldAliases = [],
--             fldDoc = Nothing,
--             fldOrder = Nothing,
--             fldType = String,
--             fldDefault = Nothing
--           }
--         ]
--       },
--       Record {
--         name = "PeopleRequest",
--         aliases = [],
--         doc = Nothing,
--         order = Nothing,
--         fields = [
--           Field {
--             fldName = "name",
--             fldAliases = [],
--             fldDoc = Nothing,
--             fldOrder = Nothing,
--             fldType = String,
--             fldDefault = Nothing
--           }
--         ]
--       },
--       Record {
--         name = "PeopleResponse",
--         aliases = [],
--         doc = Nothing,
--         order = Nothing,
--         fields = [
--           Field {
--             fldName = "result",
--             fldAliases = [],
--             fldDoc = Nothing,
--             fldOrder = Nothing,
--             fldType = Union {options = [NamedType "Person",NamedType "NotFoundError",NamedType "DuplicatedPersonError"]},
--             fldDefault = Nothing
--           }
--         ]
--       }
--     ],
--     messages = [
--       Method {
--         mname = "getPerson",
--         args = [Argument {atype = NamedType "example.seed.server.protocol.avro.PeopleRequest", aname = "request"}],
--         result = NamedType "example.seed.server.protocol.avro.PeopleResponse",
--         throws = Null,
--         oneway = False
--       }
--     ]
--   })

⚠️ Warning: readWithImports only works right now if the import type is "idl"!