Current section
Files
Jump to
Current section
Files
priv/System/Env.phi
-----------------------------------------------------------------------------
-- |
-- Module : System.Env
-- Copyright : (c) 2020-2021 EMQ Technologies Co., Ltd.
-- License : BSD-style (see the LICENSE file)
--
-- Maintainer : Feng Lee, feng@emqx.io
-- Yang M, yangm@emqx.io
-- Stability : experimental
-- Portability : portable
--
-- The System Environment module.
--
-----------------------------------------------------------------------------
module System.Env where
import Data.Maybe (Maybe)
import Data.Unit (Unit)
import Control.Monad (IO)
-- | Get all the the environment variables.
foreign import getAllEnv :: IO (List (String, String))
-- | Get the value of the environment variable.
foreign import getEnv :: String -> IO String
-- | Lookup the value of the environment variable,
-- return Nothing if there is no such value.
foreign import lookupEnv :: String -> IO (Maybe String)
-- | Set the environment variable to value.
foreign import setEnv :: String -> String -> IO ()
-- | Unset the environment variable.
foreign import unsetEnv :: String -> IO ()