lightning-haskell-0.1.0.2: Haskell client for lightning-viz REST API

Copyright(c) Connor Moreside 2016
LicenseBSD-3
Maintainerconnor@moresi.de
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Lightning

Contents

Description

 

Synopsis

Lightning Types

data LoginMethod Source #

Represents the different authentication mechanisms available in the lightning-viz server.

Constructors

Anonymous

No authentication required

BasicAuth Credentials

HTTP Basic Authentication

data LightningOptions Source #

Defines the available options for running a lightning action(s).

Constructors

LightningOptions 

Fields

data LightningState Source #

Stores the current state of the lightning transformer stack.

Constructors

LightningState 

Fields

Execute

runLightning :: MonadIO m => LightningT m a -> m (Either (APIError LightningError) a) Source #

Performs a lightning action (or LightningT transformer actions) with the default lightning options. By default, the lightning-viz server is assumed to be running on http://localhost:3000 and a new session will be created.

runLightningWith :: MonadIO m => LightningOptions -> LightningT m a -> m (Either (APIError LightningError) a) Source #

Performs a lightning action (or LightningT transformer actions) with the specified lightning options.

runResumeLightningtWith :: MonadIO m => LightningOptions -> LightningT m a -> m (Either (APIError LightningError, Maybe (LightningT m a)) a) Source #

Runs a lightning action using the specified options.

interpretIO :: MonadIO m => LightningState -> LightningT m a -> m (Either (APIError LightningError, Maybe (LightningT m a)) a) Source #

Runs a specified series of lightning actions.

Client configuration

defaultLightningOptions :: LightningOptions Source #

Defines the default lightning-viz options.

setBaseURL Source #

Arguments

:: Text

Fully qualified API base URL

-> LightningOptions 
-> LightningOptions 

Sets the base URL of Lightning's API in the given LightningOptions record.

setSessionName Source #

Arguments

:: Text

The new session name

-> LightningOptions 
-> LightningOptions 

Sets the name of the session that is nested in the given LightningOptions record.

setSessionId Source #

Arguments

:: Text

The new session ID

-> LightningOptions 
-> LightningOptions 

Sets the session ID of the session nested in the given LightningOptions record.

setBasicAuth :: Credentials -> LightningOptions -> LightningOptions Source #

Sets BasicAuth with Credentials as the login method in the given LightningOptions record.

Re-exports

data APIError a :: * -> * #

Error type for the API, where a is the type that should be returned when something goes wrong on the other end - i.e. any error that isn't directly related to this library.

Constructors

APIError a

A type that represents any error that happens on the API end. Define your own custom type with a FromJSON instance if you want to handle them, or you can use () if you just want to ignore them all.

HTTPError HttpException

Something went wrong when we tried to do a HTTP operation.

InvalidURLError

You're trying to create an invalid URL somewhere - check your Builder's base URL and your Routes.

ParseError String

Failed when parsing the response, and it wasn't an error on their end.

EmptyError

Empty error to serve as a zero element for Monoid.

Instances

Eq a => Eq (APIError a) 

Methods

(==) :: APIError a -> APIError a -> Bool #

(/=) :: APIError a -> APIError a -> Bool #

Show a => Show (APIError a) 

Methods

showsPrec :: Int -> APIError a -> ShowS #

show :: APIError a -> String #

showList :: [APIError a] -> ShowS #

Monoid (APIError a) 

Methods

mempty :: APIError a #

mappend :: APIError a -> APIError a -> APIError a #

mconcat :: [APIError a] -> APIError a #