Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.InfluxDB.Types
- newtype Query = Query Text
- data Server = Server {}
- localServer :: Server
- host :: Lens' Server Text
- port :: Lens' Server Int
- ssl :: Lens' Server Bool
- data Credentials = Credentials {}
- user :: Lens' Credentials Text
- password :: Lens' Credentials Text
- newtype Database = Database {
- databaseName :: Text
- newtype Key = Key Text
- fromNonEmptyString :: String -> String -> Text
- data FieldValue
- = FieldInt !Int64
- | FieldFloat !Double
- | FieldString !Text
- | FieldBool !Bool
- | FieldNull
- data RequestType
- data Precision ty where
- Nanosecond :: Precision ty
- Microsecond :: Precision ty
- Millisecond :: Precision ty
- Second :: Precision ty
- Minute :: Precision ty
- Hour :: Precision ty
- RFC3339 :: Precision QueryRequest
- precisionName :: Precision ty -> Text
- class Timestamp time where
- roundAt :: RealFrac a => a -> a -> a
- precisionScale :: Fractional a => Precision ty -> a
- data InfluxException
- class HasServer a where
- class HasDatabase a where
- class HasPrecision ty a | a -> ty where
- class HasManager a where
- class HasCredentials a where
Documentation
localServer :: Server Source #
Database name
Constructors
Database | |
Fields
|
String type that is used for measurements, tag keys and field keys.
data FieldValue Source #
Constructors
FieldInt !Int64 | |
FieldFloat !Double | |
FieldString !Text | |
FieldBool !Bool | |
FieldNull |
Instances
data RequestType Source #
Type of a request
Constructors
QueryRequest | Request for |
WriteRequest | Request for |
Instances
data Precision ty where Source #
Predefined set of time precision.
RFC3339
is only available for QueryRequest
s.
Constructors
Nanosecond :: Precision ty | POSIX time in ns |
Microsecond :: Precision ty | POSIX time in μs |
Millisecond :: Precision ty | POSIX time in ms |
Second :: Precision ty | POSIX time in s |
Minute :: Precision ty | POSIX time in minutes |
Hour :: Precision ty | POSIX time in hours |
RFC3339 :: Precision QueryRequest | Nanosecond precision time in a human readable format, like
|
precisionName :: Precision ty -> Text Source #
class Timestamp time where Source #
A Timestamp
is something that can be converted to a valid
InfluxDB timestamp, which is represented as a 64-bit integer.
precisionScale :: Fractional a => Precision ty -> a Source #
data InfluxException Source #
Exceptions used in this library.
In general, the library tries to convert exceptions from the dependent libraries to the following types of errors.
Constructors
ServerError String | Server side error. You can expect to get a successful response once the issue is resolved on the server side. |
BadRequest String Request | Client side error. You need to fix your query to get a successful response. |
IllformedJSON String ByteString | Unexpected JSON response. This can happen e.g. when the response from InfluxDB is incompatible with what this library expects due to an upstream format change etc. |
Instances
class HasServer a where Source #
Minimal complete definition
Instances
HasServer PingParams Source # | |
HasServer WriteParams Source # |
|
HasServer QueryParams Source # |
|
class HasDatabase a where Source #
Minimal complete definition
Instances
HasDatabase WriteParams Source # |
|
HasDatabase QueryParams Source # |
|
HasDatabase ShowQuery Source # |
|
class HasPrecision ty a | a -> ty where Source #
Minimal complete definition
Instances
HasPrecision QueryRequest QueryParams Source # | Returning JSON responses contain timestamps in the specified precision/format.
|
HasPrecision WriteRequest WriteParams Source # | Timestamp precision. In the UDP API, all timestamps are sent in nanosecond but you can specify lower precision. The writer just rounds timestamps to the specified precision. |
HasPrecision WriteRequest WriteParams Source # |
|
class HasManager a where Source #
Minimal complete definition
Methods
manager :: Lens' a (Either ManagerSettings Manager) Source #
HTTP manager settings or a manager itself.
If it's set to ManagerSettings
, the library will create a Manager
from
the settings for you.
Instances
HasManager PingParams Source # | |
HasManager WriteParams Source # |
|
HasManager QueryParams Source # |
|
class HasCredentials a where Source #
Minimal complete definition
Methods
authentication :: Lens' a (Maybe Credentials) Source #
Instances