Safe Haskell | Safe-Inferred |
---|
Airbrake.Credentials
Description
Utilities for loading the API key from the environment.
- type APIKey = String
- credentialsDefaultFile :: MonadIO m => m FilePath
- credentialsDefaultKey :: String
- loadCredentialsFromFile :: MonadIO m => FilePath -> String -> m (Maybe APIKey)
- loadCredentialsFromEnv :: MonadIO m => m (Maybe APIKey)
- loadCredentialsFromEnvOrFile :: MonadIO m => FilePath -> String -> m (Maybe APIKey)
- loadCredentialsDefault :: MonadIO m => m (Maybe APIKey)
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.
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