| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.InfluxDB.JSON
Contents
Synopsis
- parseResultsWith :: (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) -> Value -> Parser (Vector a)
- parseResultsWithDecoder :: Decoder a -> (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) -> Value -> Parser (Vector a)
- data Decoder a = Decoder {
- decodeEach :: Parser a -> Parser b
- decodeFold :: Parser (Vector b) -> Parser (Vector a)
- strictDecoder :: Decoder a
- lenientDecoder :: Decoder a
- getField :: MonadFail m => Text -> Vector Text -> Vector Value -> m Value
- getTag :: MonadFail m => Text -> HashMap Text Value -> m Value
- parseJSON :: FromJSON a => Value -> Parser a
- parseUTCTime :: Precision ty -> Value -> Parser UTCTime
- parsePOSIXTime :: Precision ty -> Value -> Parser POSIXTime
- parseRFC3339 :: ParseTime time => Value -> Parser time
- parseQueryField :: Value -> Parser QueryField
- parseResultsObject :: Value -> Parser (Vector Value)
- parseSeriesObject :: Value -> Parser (Vector Value)
- parseSeriesBody :: Value -> Parser (Maybe Text, HashMap Text Text, Vector Text, Array)
- parseErrorObject :: Value -> Parser a
Result parsers
Arguments
| :: (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) | A parser that takes
to construct a value. |
| -> Value | |
| -> Parser (Vector a) |
Parse a JSON response with the lenientDecoder. This can be useful to
implement the parseResults method.
parseResultsWithDecoder Source #
Arguments
| :: Decoder a | |
| -> (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a) | A parser that takes
to construct a value. |
| -> Value | |
| -> Parser (Vector a) |
Parse a JSON response with the specified decoder settings.
Decoder settings
Decoder settings
strictDecoder :: Decoder a Source #
A decoder that fails immediately if there's any parse failure.
lenientDecoder :: Decoder a Source #
A decoder that ignores parse failures and returns only successful results.
Getting fields and tags
Arguments
| :: MonadFail m | |
| => Text | Column name |
| -> Vector Text | Columns |
| -> Vector Value | Field values |
| -> m Value |
Get a field value from a column name
Get a tag value from a tag name
Common JSON object parsers
parseUTCTime :: Precision ty -> Value -> Parser UTCTime Source #
Parse either a POSIX timestamp or RFC3339 formatted timestamp as UTCTime.
parsePOSIXTime :: Precision ty -> Value -> Parser POSIXTime Source #
Parse either a POSIX timestamp or RFC3339 formatted timestamp as
POSIXTime.
parseQueryField :: Value -> Parser QueryField Source #
Deprecated: This function parses numbers in a misleading way. Use parseJSON instead.
Parse a QueryField.
Utility functions
parseSeriesBody :: Value -> Parser (Maybe Text, HashMap Text Text, Vector Text, Array) Source #
Parse the common JSON structure used in query responses.
parseErrorObject :: Value -> Parser a Source #
Parse the common JSON structure used in failure response.