hs-abci-server-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Network.ABCI.Server.App

Synopsis

Documentation

newtype App m Source #

Application type that represents a well typed application, i.e. a function from a typed Request to a typed Response.

Constructors

App 

Fields

runApp :: forall m. Applicative m => App m -> LPByteStrings -> m LPByteStrings Source #

Compiles App down to AppBS

transformApp :: (forall (t :: MessageType). m (Response t) -> g (Response t)) -> App m -> App g Source #

Transform an application from running in a custom monad to running in IO.

withProto :: (forall (t :: MessageType). Request t -> a) -> Request'Value -> a Source #

type Middleware m = App m -> App m Source #

Middleware is a component that sits between the server and application. It can do such tasks as logging or response caching. What follows is the general definition of middleware, though a middleware author should feel free to modify this.

data Request (m :: MessageType) :: Type where Source #

Instances

Instances details
FromJSON (Request 'MTEcho) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTEcho)

parseJSONList :: Value -> Parser [Request 'MTEcho]

FromJSON (Request 'MTFlush) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTFlush)

parseJSONList :: Value -> Parser [Request 'MTFlush]

FromJSON (Request 'MTInfo) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTInfo)

parseJSONList :: Value -> Parser [Request 'MTInfo]

FromJSON (Request 'MTSetOption) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTSetOption)

parseJSONList :: Value -> Parser [Request 'MTSetOption]

FromJSON (Request 'MTInitChain) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTInitChain)

parseJSONList :: Value -> Parser [Request 'MTInitChain]

FromJSON (Request 'MTQuery) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTQuery)

parseJSONList :: Value -> Parser [Request 'MTQuery]

FromJSON (Request 'MTBeginBlock) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTBeginBlock)

parseJSONList :: Value -> Parser [Request 'MTBeginBlock]

FromJSON (Request 'MTCheckTx) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTCheckTx)

parseJSONList :: Value -> Parser [Request 'MTCheckTx]

FromJSON (Request 'MTDeliverTx) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTDeliverTx)

parseJSONList :: Value -> Parser [Request 'MTDeliverTx]

FromJSON (Request 'MTEndBlock) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTEndBlock)

parseJSONList :: Value -> Parser [Request 'MTEndBlock]

FromJSON (Request 'MTCommit) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Request 'MTCommit)

parseJSONList :: Value -> Parser [Request 'MTCommit]

ToJSON (Request t) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

toJSON :: Request t -> Value

toEncoding :: Request t -> Encoding

toJSONList :: [Request t] -> Value

toEncodingList :: [Request t] -> Encoding

data Response (m :: MessageType) :: Type where Source #

Instances

Instances details
FromJSON (Response 'MTEcho) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTEcho)

parseJSONList :: Value -> Parser [Response 'MTEcho]

FromJSON (Response 'MTFlush) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTFlush)

parseJSONList :: Value -> Parser [Response 'MTFlush]

FromJSON (Response 'MTInfo) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTInfo)

parseJSONList :: Value -> Parser [Response 'MTInfo]

FromJSON (Response 'MTSetOption) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTSetOption)

parseJSONList :: Value -> Parser [Response 'MTSetOption]

FromJSON (Response 'MTInitChain) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTInitChain)

parseJSONList :: Value -> Parser [Response 'MTInitChain]

FromJSON (Response 'MTQuery) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTQuery)

parseJSONList :: Value -> Parser [Response 'MTQuery]

FromJSON (Response 'MTBeginBlock) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTBeginBlock)

parseJSONList :: Value -> Parser [Response 'MTBeginBlock]

FromJSON (Response 'MTCheckTx) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTCheckTx)

parseJSONList :: Value -> Parser [Response 'MTCheckTx]

FromJSON (Response 'MTDeliverTx) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTDeliverTx)

parseJSONList :: Value -> Parser [Response 'MTDeliverTx]

FromJSON (Response 'MTEndBlock) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTEndBlock)

parseJSONList :: Value -> Parser [Response 'MTEndBlock]

FromJSON (Response 'MTCommit) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

parseJSON :: Value -> Parser (Response 'MTCommit)

parseJSONList :: Value -> Parser [Response 'MTCommit]

ToJSON (Response t) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

toJSON :: Response t -> Value

toEncoding :: Response t -> Encoding

toJSONList :: [Response t] -> Value

toEncodingList :: [Response t] -> Encoding

Default (Response 'MTEcho) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

def :: Response 'MTEcho

Default (Response 'MTFlush) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

def :: Response 'MTFlush

Default (Response 'MTInfo) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

def :: Response 'MTInfo

Default (Response 'MTSetOption) Source # 
Instance details

Defined in Network.ABCI.Server.App

Default (Response 'MTInitChain) Source # 
Instance details

Defined in Network.ABCI.Server.App

Default (Response 'MTQuery) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

def :: Response 'MTQuery

Default (Response 'MTBeginBlock) Source # 
Instance details

Defined in Network.ABCI.Server.App

Default (Response 'MTCheckTx) Source # 
Instance details

Defined in Network.ABCI.Server.App

Default (Response 'MTDeliverTx) Source # 
Instance details

Defined in Network.ABCI.Server.App

Default (Response 'MTEndBlock) Source # 
Instance details

Defined in Network.ABCI.Server.App

Default (Response 'MTCommit) Source # 
Instance details

Defined in Network.ABCI.Server.App

Methods

def :: Response 'MTCommit

decodeLengthPrefix :: LPByteStrings -> Either DecodeError [ByteString] Source #

Decodes varlength-prefixed ByteString into ByteStrings

encodeLengthPrefix :: [ByteString] -> LPByteStrings Source #

Encodes ByteStrings into varlength-prefixed ByteString