airbrake-0.2.0.0: An Airbrake notifier for Haskell

Safe HaskellSafe-Inferred

Airbrake.Credentials

Description

Utilities for loading the API key from the environment.

Synopsis

Documentation

credentialsDefaultFile :: MonadIO m => m FilePathSource

The file where API credentials are loaded when using loadCredentialsDefault.

Default: $HOME/.airbrake-keys

credentialsDefaultKey :: StringSource

The key to be used in the loaded API credentials file, when using loadCredentialsDefault.

Default: default

loadCredentialsFromFile :: MonadIO m => FilePath -> String -> m (Maybe APIKey)Source

Load API credentials from a text file given a key name.

The file should consist of newline-separated credentials in the following format:

keyName apiKey

loadCredentialsFromEnv :: MonadIO m => m (Maybe APIKey)Source

Load API credentials from the environment variable AIRBRAKE_API_KEY.

loadCredentialsFromEnvOrFile :: MonadIO m => FilePath -> String -> m (Maybe APIKey)Source

Load API credentials from the environment, or, failing that, from the given file with the given key name.

See loadCredentialsFromEnv and loadCredentialsFromFile.

loadCredentialsDefault :: MonadIO m => m (Maybe APIKey)Source

Load API credentials from the environment if possible, or alternately from the default file with the default key name.

Default file: $HOME/.airbrake-keys

Default key: default

See loadCredentialsFromEnv and loadCredentialsFromFile.