Copyright | Copyright (c) 2015, Michael Alan Dorman |
---|---|
License | MIT |
Maintainer | mdorman@jaunder.io |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module is intended to be import qualified
. No attempt has been made to keep names of types or functions from clashing with obvious or otherwise commonly-used names, or even other modules within this package.
The functions here are derived from (and presented in the same order as) the Server API documentation. For each function, we attempt to link back to the original documentation, as well as make a notation as to how complete and correct we feel our implementation is.
Each function takes a Context
as its final parameter, and returns a Result
.
- meta :: (FromJSON a, MonadIO m) => Context -> m (Result a)
- activeTasks :: (FromJSON a, MonadIO m) => Context -> m (Result a)
- allDbs :: (FromJSON a, MonadIO m) => Context -> m (Result a)
- dbUpdates :: (FromJSON a, MonadIO m) => DbUpdates -> Context -> m (Result a)
- log :: MonadIO m => Context -> m (Result Text)
- replicate :: (FromJSON a, MonadIO m) => Context -> m (Result a)
- restart :: (FromJSON a, MonadIO m) => Context -> m (Result a)
- stats :: (FromJSON a, MonadIO m) => Context -> m (Result a)
- uuids :: (FromJSON a, MonadIO m) => Int -> Context -> m (Result a)
Documentation
meta :: (FromJSON a, MonadIO m) => Context -> m (Result a) Source
Get most basic meta-information
The return value is an object whose fields often vary, so it is most easily decoded as a Value
:
>>>
value :: Result Value <- Server.meta ctx
Status: Complete
activeTasks :: (FromJSON a, MonadIO m) => Context -> m (Result a) Source
allDbs :: (FromJSON a, MonadIO m) => Context -> m (Result a) Source
dbUpdates :: (FromJSON a, MonadIO m) => DbUpdates -> Context -> m (Result a) Source
Get a list of all database events
This call does not yet stream out results, so it's functionality is limited.
The return value is a list of database update events, so it is easily decoded into a List
of Value
:
>>>
value :: Result [Value] <- Server.dbUpdates ctx
Status: Limited
log :: MonadIO m => Context -> m (Result Text) Source
Get the log output of the server
This call doesn't return a JSON result, so we're deferring support for the moment.
Status: Unimplemented
replicate :: (FromJSON a, MonadIO m) => Context -> m (Result a) Source
Administer replication for databases on the server
We do not yet have a structure for specifying parameters to this call, so we're deferring support for the moment
Status: Unimplemented
restart :: (FromJSON a, MonadIO m) => Context -> m (Result a) Source
The return value is an object that should only contain a single key "ok", so it is easily decoded into a Bool
with our asBool
combinator:
>>>
value :: Result Bool <- Server.restart ctx >>= asBool
Status: Complete
stats :: (FromJSON a, MonadIO m) => Context -> m (Result a) Source
The return value is an object whose fields often vary, so it is most easily decoded as a Value
:
>>>
value :: Result Value <- Server.stats ctx
Status: Complete