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

Mu.Adapter.Avro

Description

Just import the module and you can turn any value with a ToSchema and FromSchema from and to Avro values.

Orphan instances

ToSchemalessTerm (Value t) Identity Source # 
Instance details

Methods

toSchemalessTerm :: Value t -> Term Identity

ToSchemalessValue (Value t) Identity Source # 
Instance details

Methods

toSchemalessValue :: Value t -> FieldValue Identity

FromAvro t => FromAvro (FieldValue f sch ('TPrimitive t :: FieldTypeB Type typeName)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch ('TPrimitive t)) #

FromAvro (FieldValue f sch ('TNull :: FieldTypeB Type typeName)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch 'TNull) #

(HasAvroSchema' (FieldValue f sch v), FromAvro (FieldValue f sch v)) => FromAvro (FieldValue f sch ('TMap ('TPrimitive String :: FieldTypeB Type typeName) v)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch ('TMap ('TPrimitive String) v)) #

(HasAvroSchema' (FieldValue f sch v), FromAvro (FieldValue f sch v)) => FromAvro (FieldValue f sch ('TMap ('TPrimitive Text :: FieldTypeB Type typeName) v)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch ('TMap ('TPrimitive Text) v)) #

(HasAvroSchema' (FieldValue f sch t), FromAvro (FieldValue f sch t)) => FromAvro (FieldValue f sch ('TList t)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch ('TList t)) #

(HasAvroSchema' (FieldValue f sch t), FromAvro (FieldValue f sch t)) => FromAvro (FieldValue f sch ('TOption t)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch ('TOption t)) #

(KnownName t, HasAvroSchema' (Term f sch (sch :/: t)), FromAvro (Term f sch (sch :/: t))) => FromAvro (FieldValue f sch ('TSchematic t :: FieldTypeB Type typeName)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch ('TSchematic t)) #

(HasAvroSchemaUnion (FieldValue f sch) choices, FromAvroUnion f sch choices) => FromAvro (FieldValue f sch ('TUnion choices)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (FieldValue f sch ('TUnion choices)) #

(KnownName name, HasAvroSchemaFields sch args, FromAvroFields f sch args) => FromAvro (Term f sch ('DRecord name args)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (Term f sch ('DRecord name args)) #

(HasAvroSchema' (FieldValue f sch t), FromAvro (FieldValue f sch t)) => FromAvro (Term f sch ('DSimple t :: TypeDefB Type typeName fieldName)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (Term f sch ('DSimple t)) #

(KnownName name, HasAvroSchemaEnum choices, FromAvroEnum choices) => FromAvro (Term f sch ('DEnum name choices :: TypeDefB Type typeName fieldName)) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (Term f sch ('DEnum name choices)) #

ToAvro t => ToAvro (FieldValue Identity sch ('TPrimitive t :: FieldTypeB Type typeName)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch ('TPrimitive t) -> Value Schema #

ToAvro (FieldValue Identity sch ('TNull :: FieldTypeB Type typeName)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch 'TNull -> Value Schema #

(HasAvroSchema' (FieldValue Identity sch v), ToAvro (FieldValue Identity sch v)) => ToAvro (FieldValue Identity sch ('TMap ('TPrimitive String :: FieldTypeB Type typeName) v)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch ('TMap ('TPrimitive String) v) -> Value Schema #

(HasAvroSchema' (FieldValue Identity sch v), ToAvro (FieldValue Identity sch v)) => ToAvro (FieldValue Identity sch ('TMap ('TPrimitive Text :: FieldTypeB Type typeName) v)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch ('TMap ('TPrimitive Text) v) -> Value Schema #

(HasAvroSchema' (FieldValue Identity sch t), ToAvro (FieldValue Identity sch t)) => ToAvro (FieldValue Identity sch ('TList t)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch ('TList t) -> Value Schema #

(HasAvroSchema' (FieldValue Identity sch t), ToAvro (FieldValue Identity sch t)) => ToAvro (FieldValue Identity sch ('TOption t)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch ('TOption t) -> Value Schema #

(KnownName t, HasAvroSchema' (Term Identity sch (sch :/: t)), ToAvro (Term Identity sch (sch :/: t))) => ToAvro (FieldValue Identity sch ('TSchematic t :: FieldTypeB Type typeName)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch ('TSchematic t) -> Value Schema #

(HasAvroSchemaUnion (FieldValue Identity sch) choices, ToAvroUnion sch choices) => ToAvro (FieldValue Identity sch ('TUnion choices)) Source # 
Instance details

Methods

toAvro :: FieldValue Identity sch ('TUnion choices) -> Value Schema #

(KnownName name, HasAvroSchemaFields sch args, ToAvroFields sch args) => ToAvro (Term Identity sch ('DRecord name args)) Source # 
Instance details

Methods

toAvro :: Term Identity sch ('DRecord name args) -> Value Schema #

(HasAvroSchema' (FieldValue Identity sch t), ToAvro (FieldValue Identity sch t)) => ToAvro (Term Identity sch ('DSimple t :: TypeDefB Type typeName fieldName)) Source # 
Instance details

Methods

toAvro :: Term Identity sch ('DSimple t) -> Value Schema #

(KnownName name, HasAvroSchemaEnum choices, ToAvroEnum choices) => ToAvro (Term Identity sch ('DEnum name choices :: TypeDefB Type typeName fieldName)) Source # 
Instance details

Methods

toAvro :: Term Identity sch ('DEnum name choices) -> Value Schema #

HasAvroSchema' (FieldValue f sch t) => HasAvroSchema (FieldValue f sch t) Source # 
Instance details

Methods

schema :: Tagged (FieldValue f sch t) Schema #

HasAvroSchema' (Term f sch t) => HasAvroSchema (Term f sch t) Source # 
Instance details

Methods

schema :: Tagged (Term f sch t) Schema #

(FromSchema f sch sty t, FromAvro (Term f sch (sch :/: sty))) => FromAvro (WithSchema f sch sty t) Source # 
Instance details

Methods

fromAvro :: Value Schema -> Result (WithSchema f sch sty t) #

(ToSchema Identity sch sty t, ToAvro (Term Identity sch (sch :/: sty))) => ToAvro (WithSchema Identity sch sty t) Source # 
Instance details

Methods

toAvro :: WithSchema Identity sch sty t -> Value Schema #

HasAvroSchema (Term f sch (sch :/: sty)) => HasAvroSchema (WithSchema f sch sty t) Source # 
Instance details

Methods

schema :: Tagged (WithSchema f sch sty t) Schema #