Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Result a = Either Error a
- newtype Error = ExtismError String
- data LogLevel
- data Plugin = Plugin Context Int32
- newtype Context = Context (ForeignPtr ExtismContext)
- toByteString :: String -> ByteString
- fromByteString :: ByteString -> String
- extismVersion :: () -> IO String
- reset :: Context -> IO ()
- newContext :: IO Context
- withContext :: (Context -> IO a) -> IO a
- plugin :: Context -> ByteString -> Bool -> IO (Result Plugin)
- pluginFromManifest :: Context -> Manifest -> Bool -> IO (Result Plugin)
- update :: Plugin -> ByteString -> Bool -> IO (Result ())
- updateManifest :: Plugin -> Manifest -> Bool -> IO (Result ())
- isValid :: Plugin -> Bool
- setConfig :: Plugin -> [(String, Maybe String)] -> IO Bool
- levelStr :: LogLevel -> String
- setLogFile :: String -> LogLevel -> IO Bool
- functionExists :: Plugin -> String -> IO Bool
- call :: Plugin -> String -> ByteString -> IO (Result ByteString)
- free :: Plugin -> IO ()
- toString :: JSON a => a -> String
- data Manifest
Documentation
Extism error
Log level
toByteString :: String -> ByteString Source #
Helper function to convert a String
to a ByteString
fromByteString :: ByteString -> String Source #
Helper function to convert a ByteString
to a String
extismVersion :: () -> IO String Source #
Get the Extism version string
withContext :: (Context -> IO a) -> IO a Source #
Execute a function with a new Context
that is destroyed when it returns
plugin :: Context -> ByteString -> Bool -> IO (Result Plugin) Source #
Create a Plugin
from a WASM module, useWasi
determines if WASI should
| be linked
update :: Plugin -> ByteString -> Bool -> IO (Result ()) Source #
Update a Plugin
with a new WASM module
setConfig :: Plugin -> [(String, Maybe String)] -> IO Bool Source #
Set configuration values for a plugin
setLogFile :: String -> LogLevel -> IO Bool Source #
Set the log file and level, this is a global configuration
functionExists :: Plugin -> String -> IO Bool Source #
Check if a function exists in the given plugin
call :: Plugin -> String -> ByteString -> IO (Result ByteString) Source #