diff options
Diffstat (limited to 'fig-monitor-bullfrog/src/Fig/Monitor/Bullfrog/Utils.hs')
| -rw-r--r-- | fig-monitor-bullfrog/src/Fig/Monitor/Bullfrog/Utils.hs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/fig-monitor-bullfrog/src/Fig/Monitor/Bullfrog/Utils.hs b/fig-monitor-bullfrog/src/Fig/Monitor/Bullfrog/Utils.hs deleted file mode 100644 index b0ae02b..0000000 --- a/fig-monitor-bullfrog/src/Fig/Monitor/Bullfrog/Utils.hs +++ /dev/null @@ -1,29 +0,0 @@ -{-# Language ApplicativeDo #-} - -module Fig.Monitor.Bullfrog.Utils - ( FigMonitorBullfrogException(..) - , Config(..) - , loadConfig - ) where - -import Fig.Prelude - -import qualified Toml - -newtype FigMonitorBullfrogException = FigMonitorBullfrogException Text - deriving (Show, Eq, Ord) -instance Exception FigMonitorBullfrogException - -newtype Config = Config - { authToken :: Text - } deriving (Show, Eq, Ord) - -configCodec :: Toml.TomlCodec Config -configCodec = do - authToken <- Toml.text "auth_token" Toml..= (\a -> a.authToken) - pure $ Config{..} - -loadConfig :: FilePath -> IO Config -loadConfig path = Toml.decodeFileEither configCodec path >>= \case - Left err -> throwM . FigMonitorBullfrogException $ tshow err - Right config -> pure config |
