| Copyright | Copyright © 2014 AlephCloud Systems, Inc. |
|---|---|
| License | MIT |
| Maintainer | Lars Kuhtz <lars@alephcloud.com> |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Configuration.Utils.Validation
Description
Utilities for validating configuration values
- validateHttpOrHttpsUrl :: Text -> ConfigValidation String λ
- validateHttpUrl :: Text -> ConfigValidation String λ
- validateHttpsUrl :: Text -> ConfigValidation String λ
- validateUri :: Text -> ConfigValidation String λ
- validateAbsoluteUri :: Text -> ConfigValidation String λ
- validateAbsoluteUriFragment :: Text -> ConfigValidation String λ
- validateIPv4 :: Text -> ConfigValidation String λ
- validateIPv6 :: Text -> ConfigValidation String λ
- validatePort :: Text -> ConfigValidation Int λ
- validateNonEmpty :: (Eq α, Monoid α) => Text -> ConfigValidation α λ
- validateLength :: Foldable φ => Text -> Int -> ConfigValidation (φ α) λ
- validateMinLength :: Foldable φ => Text -> Int -> ConfigValidation (φ α) λ
- validateMaxLength :: Foldable φ => Text -> Int -> ConfigValidation (φ α) λ
- validateMinMaxLength :: Foldable φ => Text -> Int -> Int -> ConfigValidation (φ α) λ
- validateFilePath :: Text -> ConfigValidation FilePath λ
- validateFile :: Text -> ConfigValidation FilePath λ
- validateFileReadable :: Text -> ConfigValidation FilePath λ
- validateFileWritable :: Text -> ConfigValidation FilePath λ
- validateExecutable :: Text -> ConfigValidation FilePath λ
- validateDirectory :: Text -> ConfigValidation FilePath λ
- validateFalse :: MonadError Text m => Text -> Bool -> m ()
- validateTrue :: MonadError Text m => Text -> Bool -> m ()
- validateBool :: MonadError Text m => Text -> Bool -> Bool -> m ()
- validateNonNegative :: (Ord α, Num α) => Text -> ConfigValidation α λ
- validatePositive :: (Ord α, Num α) => Text -> ConfigValidation α λ
- validateNonPositive :: (Ord α, Num α) => Text -> ConfigValidation α λ
- validateNegative :: (Ord α, Num α) => Text -> ConfigValidation α λ
- validateNonNull :: (Eq α, Num α) => Text -> ConfigValidation α λ
- validateLess :: (Ord α, Show α) => Text -> α -> ConfigValidation α λ
- validateLessEq :: (Ord α, Show α) => Text -> α -> ConfigValidation α λ
- validateGreater :: (Ord α, Show α) => Text -> α -> ConfigValidation α λ
- validateGreaterEq :: (Ord α, Show α) => Text -> α -> ConfigValidation α λ
- validateRange :: (Ord α, Show α) => Text -> (α, α) -> ConfigValidation α λ
Networking
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Validates that a value is an HTTP or HTTPS URL
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Validates that a value is an HTTP URL
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Validates that a value is an HTTPS URL
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Validates that a value is an URI without a fragment identifier
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Validates that a value is an absolute URI without a fragment identifier
validateAbsoluteUriFragment Source
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Validates that a value is an absolute URI with an optional fragment identifier
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation String λ |
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation Int λ |
Monoids, Foldables and Co
Arguments
| :: (Eq α, Monoid α) | |
| => Text | configuration property name that is used in the error message |
| -> ConfigValidation α λ |
Arguments
| :: Foldable φ | |
| => Text | configuration property name that is used in the error message |
| -> Int | exact length of the validated value |
| -> ConfigValidation (φ α) λ |
Arguments
| :: Foldable φ | |
| => Text | configuration property name that is used in the error message |
| -> Int | minimum length of the validated value |
| -> ConfigValidation (φ α) λ |
Arguments
| :: Foldable φ | |
| => Text | configuration property name that is used in the error message |
| -> Int | maximum length of the validated value |
| -> ConfigValidation (φ α) λ |
Arguments
| :: Foldable φ | |
| => Text | configuration property name that is used in the error message |
| -> Int | minimum length of the validated value |
| -> Int | maximum length of the validated value |
| -> ConfigValidation (φ α) λ |
Files
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation FilePath λ |
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation FilePath λ |
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation FilePath λ |
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation FilePath λ |
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation FilePath λ |
Validates if the given executable name can be found in the system and can be executed.
Arguments
| :: Text | configuration property name that is used in the error message |
| -> ConfigValidation FilePath λ |
Boolean Values
Arguments
| :: MonadError Text m | |
| => Text | configuration property name that is used in the error message |
| -> Bool | |
| -> m () |
Arguments
| :: MonadError Text m | |
| => Text | configuration property name that is used in the error message |
| -> Bool | |
| -> m () |
Arguments
| :: MonadError Text m | |
| => Text | configuration property name that is used in the error message |
| -> Bool | expected value |
| -> Bool | |
| -> m () |
Numeric Values
Arguments
| :: (Ord α, Num α) | |
| => Text | configuration property name that is used in the error message |
| -> ConfigValidation α λ |
Arguments
| :: (Ord α, Num α) | |
| => Text | configuration property name that is used in the error message |
| -> ConfigValidation α λ |
Arguments
| :: (Ord α, Num α) | |
| => Text | configuration property name that is used in the error message |
| -> ConfigValidation α λ |
Arguments
| :: (Ord α, Num α) | |
| => Text | configuration property name that is used in the error message |
| -> ConfigValidation α λ |
Arguments
| :: (Eq α, Num α) | |
| => Text | configuration property name that is used in the error message |
| -> ConfigValidation α λ |
Orders
Arguments
| :: (Ord α, Show α) | |
| => Text | configuration property name that is used in the error message |
| -> α | a strict upper bound for the configuration value |
| -> ConfigValidation α λ |
Arguments
| :: (Ord α, Show α) | |
| => Text | configuration property name that is used in the error message |
| -> α | a upper bound for the configuration value |
| -> ConfigValidation α λ |
Arguments
| :: (Ord α, Show α) | |
| => Text | configuration property name that is used in the error message |
| -> α | a strict lower bound for the configuration value |
| -> ConfigValidation α λ |
Arguments
| :: (Ord α, Show α) | |
| => Text | configuration property name that is used in the error message |
| -> α | a lower bound for the configuration value |
| -> ConfigValidation α λ |
Arguments
| :: (Ord α, Show α) | |
| => Text | configuration property name that is used in the error message |
| -> (α, α) | the valid range for the configuration value |
| -> ConfigValidation α λ |