Copyright | Copyright © 2014 AlephCloud Systems, Inc. |
---|---|
License | MIT |
Maintainer | Lars Kuhtz <lars@alephcloud.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
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
:: Text | configuration property name that is used in the error message |
-> ConfigValidation String λ |
Validates that a value is an HTTP or HTTPS URL
:: Text | configuration property name that is used in the error message |
-> ConfigValidation String λ |
Validates that a value is an HTTP URL
:: Text | configuration property name that is used in the error message |
-> ConfigValidation String λ |
Validates that a value is an HTTPS URL
:: Text | configuration property name that is used in the error message |
-> ConfigValidation String λ |
Validates that a value is an URI without a fragment identifier
:: 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
:: 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
:: Text | configuration property name that is used in the error message |
-> ConfigValidation String λ |
:: Text | configuration property name that is used in the error message |
-> ConfigValidation String λ |
:: Text | configuration property name that is used in the error message |
-> ConfigValidation Int λ |
Monoids, Foldables and Co
:: (Eq α, Monoid α) | |
=> Text | configuration property name that is used in the error message |
-> ConfigValidation α λ |
:: Foldable φ | |
=> Text | configuration property name that is used in the error message |
-> Int | exact length of the validated value |
-> ConfigValidation (φ α) λ |
:: Foldable φ | |
=> Text | configuration property name that is used in the error message |
-> Int | minimum length of the validated value |
-> ConfigValidation (φ α) λ |
:: Foldable φ | |
=> Text | configuration property name that is used in the error message |
-> Int | maximum length of the validated value |
-> ConfigValidation (φ α) λ |
:: 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
:: Text | configuration property name that is used in the error message |
-> ConfigValidation FilePath λ |
:: Text | configuration property name that is used in the error message |
-> ConfigValidation FilePath λ |
:: Text | configuration property name that is used in the error message |
-> ConfigValidation FilePath λ |
:: Text | configuration property name that is used in the error message |
-> ConfigValidation FilePath λ |
:: 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.
:: Text | configuration property name that is used in the error message |
-> ConfigValidation FilePath λ |
Boolean Values
:: MonadError Text m | |
=> Text | configuration property name that is used in the error message |
-> Bool | |
-> m () |
:: MonadError Text m | |
=> Text | configuration property name that is used in the error message |
-> Bool | |
-> m () |
:: MonadError Text m | |
=> Text | configuration property name that is used in the error message |
-> Bool | expected value |
-> Bool | |
-> m () |
Numeric Values
:: (Ord α, Num α) | |
=> Text | configuration property name that is used in the error message |
-> ConfigValidation α λ |
:: (Ord α, Num α) | |
=> Text | configuration property name that is used in the error message |
-> ConfigValidation α λ |
:: (Ord α, Num α) | |
=> Text | configuration property name that is used in the error message |
-> ConfigValidation α λ |
:: (Ord α, Num α) | |
=> Text | configuration property name that is used in the error message |
-> ConfigValidation α λ |
:: (Eq α, Num α) | |
=> Text | configuration property name that is used in the error message |
-> ConfigValidation α λ |
Orders
:: (Ord α, Show α) | |
=> Text | configuration property name that is used in the error message |
-> α | a strict upper bound for the configuration value |
-> ConfigValidation α λ |
:: (Ord α, Show α) | |
=> Text | configuration property name that is used in the error message |
-> α | a upper bound for the configuration value |
-> ConfigValidation α λ |
:: (Ord α, Show α) | |
=> Text | configuration property name that is used in the error message |
-> α | a strict lower bound for the configuration value |
-> ConfigValidation α λ |
:: (Ord α, Show α) | |
=> Text | configuration property name that is used in the error message |
-> α | a lower bound for the configuration value |
-> ConfigValidation α λ |
:: (Ord α, Show α) | |
=> Text | configuration property name that is used in the error message |
-> (α, α) | the valid range for the configuration value |
-> ConfigValidation α λ |