Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- plugin :: Value -> InitMonad s -> PluginApp s -> IO ()
- release :: Id -> PluginMonad a ()
- reject :: Id -> PluginMonad a ()
- respond :: Value -> Id -> PluginMonad a ()
- type PluginApp a = PluginReq -> PluginMonad a ()
- type PluginMonad a = ReaderT Plug (StateT a IO)
- type InitMonad a = ReaderT Plug IO a
- type PluginReq = (Maybe Id, Method, Params)
- data Plug = Plug {}
Documentation
plugin :: Value -> InitMonad s -> PluginApp s -> IO () Source #
Create main executable that can be installed as core lightning plugin. 1st arg is the manifest that configures the interface, 2nd arg is a function with Plug reader that returns initial state, and 3rd arg is a function that is called each time data is received.
release :: Id -> PluginMonad a () Source #
Helper function to allow node to continue default behaviour.
reject :: Id -> PluginMonad a () Source #
Helper function to prevent node default behaviour.
respond :: Value -> Id -> PluginMonad a () Source #
Respond with arbitrary Value, custom rpc hooks will pass back through to terminal.
type PluginApp a = PluginReq -> PluginMonad a () Source #
Function called on every event subscribed to in the manifest.
type PluginMonad a = ReaderT Plug (StateT a IO) Source #
Plugin stack contains ReaderT (ask - rpc handle & config), stateT (get/put - polymorphic state)