ganeti
Safe HaskellNone

Ganeti.THH.Field

Description

Helpers for creating various kinds of Fields.

They aren't directly needed for the Template Haskell code in Ganeti.THH, so better keep them in a separate module.

Synopsis

Internal functions

numericalReadFn :: JSON a => (String -> Result a) -> [(String, JSValue)] -> JSValue -> Result a Source #

Wrapper around a special parse function, suitable as field-parsing function.

specialNumericalField :: Name -> Field -> Field Source #

Sets the read function to also accept string parsable by the given function.

timeAsDoubleField :: String -> Field Source #

Creates a new mandatory field that reads time as the (floating point) number of seconds since the standard UNIX epoch, and represents it in Haskell as ClockTime.

integralField :: Q Type -> String -> Field Source #

A helper function for creating fields whose Haskell representation is Integral and which are serialized as numbers.

External functions and data types

timeStampFields :: [Field] Source #

Timestamp fields description.

serialFields :: [Field] Source #

Serial number fields description.

uuidFields :: [Field] Source #

UUID fields description.

newtype TagSet Source #

Tag set type.

Constructors

TagSet 

Fields

Instances

Instances details
Eq TagSet # 
Instance details

Defined in Ganeti.THH.Field

Methods

(==) :: TagSet -> TagSet -> Bool

(/=) :: TagSet -> TagSet -> Bool

Show TagSet # 
Instance details

Defined in Ganeti.THH.Field

Methods

showsPrec :: Int -> TagSet -> ShowS

show :: TagSet -> String

showList :: [TagSet] -> ShowS

JSON TagSet # 
Instance details

Defined in Ganeti.THH.Field

Methods

readJSON :: JSValue -> Result TagSet

showJSON :: TagSet -> JSValue

readJSONs :: JSValue -> Result [TagSet]

showJSONs :: [TagSet] -> JSValue

Arbitrary TagSet 
Instance details

Defined in Test.Ganeti.TestCommon

Methods

arbitrary :: Gen TagSet

shrink :: TagSet -> [TagSet]

emptyTagSet :: TagSet Source #

Empty tag set value.

tagsFields :: [Field] Source #

Tag field description.

Fields related to POSIX data types

fileModeAsIntField :: String -> Field Source #

Creates a new mandatory field that reads a file mode in the standard POSIX file mode representation. The Haskell type of the field is FileMode.

processIdField :: String -> Field Source #

Creates a new mandatory field that contains a POSIX process ID.