influxdb-0.10.0: Haskell client library for InfluxDB

Safe HaskellNone
LanguageHaskell2010

Database.InfluxDB.Encode

Synopsis

Documentation

class ToSeries a where Source #

A type that can be converted to a Series.

Minimal complete definition

toSeries

Methods

toSeries :: a -> Series Source #

class ToSeriesData a where Source #

A type that can be converted to a SeriesData. A typical implementation is as follows.

import qualified Data.Vector as V

data Event = Event Text EventType
data EventType = Login | Logout

instance ToSeriesData Event where
  toSeriesColumns _ = V.fromList ["user", "type"]
  toSeriesPoints (Event user ty) = V.fromList [toValue user, toValue ty]

instance ToValue EventType

Minimal complete definition

toSeriesColumns, toSeriesPoints

Methods

toSeriesColumns :: Proxy a -> Vector Column Source #

Column names. You can safely ignore the proxy agument.

toSeriesPoints :: a -> Vector Value Source #

Data points.

class ToValue a where Source #

A type that can be stored in InfluxDB.

Minimal complete definition

toValue

Methods

toValue :: a -> Value Source #