configuration-tools-0.2.8: Tools for specifying and parsing configurations

CopyrightCopyright © 2014 AlephCloud Systems, Inc.
LicenseMIT
MaintainerLars Kuhtz <lars@alephcloud.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Configuration.Utils.Validation

Contents

Description

Utilities for validating configuration values

Synopsis

Networking

validateHttpOrHttpsUrl Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation String λ 

Validates that a value is an HTTP or HTTPS URL

validateHttpUrl Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation String λ 

Validates that a value is an HTTP URL

validateHttpsUrl Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation String λ 

Validates that a value is an HTTPS URL

validateUri Source

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

validateAbsoluteUri Source

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

validateIPv4 Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation String λ 

validateIPv6 Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation String λ 

validatePort Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation Int λ 

Monoids, Foldables and Co

validateNonEmpty Source

Arguments

:: (Eq α, Monoid α) 
=> Text

configuration property name that is used in the error message

-> ConfigValidation α λ 

validateLength Source

Arguments

:: Foldable φ 
=> Text

configuration property name that is used in the error message

-> Int

exact length of the validated value

-> ConfigValidation (φ α) λ 

validateMinLength Source

Arguments

:: Foldable φ 
=> Text

configuration property name that is used in the error message

-> Int

minimum length of the validated value

-> ConfigValidation (φ α) λ 

validateMaxLength Source

Arguments

:: Foldable φ 
=> Text

configuration property name that is used in the error message

-> Int

maximum length of the validated value

-> ConfigValidation (φ α) λ 

validateMinMaxLength Source

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

validateFilePath Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation FilePath λ 

validateFile Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation FilePath λ 

validateFileReadable Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation FilePath λ 

validateFileWritable Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation FilePath λ 

validateExecutable Source

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.

validateDirectory Source

Arguments

:: Text

configuration property name that is used in the error message

-> ConfigValidation FilePath λ 

Boolean Values

validateFalse Source

Arguments

:: MonadError Text m 
=> Text

configuration property name that is used in the error message

-> Bool 
-> m () 

validateTrue Source

Arguments

:: MonadError Text m 
=> Text

configuration property name that is used in the error message

-> Bool 
-> m () 

validateBool Source

Arguments

:: MonadError Text m 
=> Text

configuration property name that is used in the error message

-> Bool

expected value

-> Bool 
-> m () 

Numeric Values

validateNonNegative Source

Arguments

:: (Ord α, Num α) 
=> Text

configuration property name that is used in the error message

-> ConfigValidation α λ 

validatePositive Source

Arguments

:: (Ord α, Num α) 
=> Text

configuration property name that is used in the error message

-> ConfigValidation α λ 

validateNonPositive Source

Arguments

:: (Ord α, Num α) 
=> Text

configuration property name that is used in the error message

-> ConfigValidation α λ 

validateNegative Source

Arguments

:: (Ord α, Num α) 
=> Text

configuration property name that is used in the error message

-> ConfigValidation α λ 

validateNonNull Source

Arguments

:: (Eq α, Num α) 
=> Text

configuration property name that is used in the error message

-> ConfigValidation α λ 

Orders

validateLess Source

Arguments

:: (Ord α, Show α) 
=> Text

configuration property name that is used in the error message

-> α

a strict upper bound for the configuration value

-> ConfigValidation α λ 

validateLessEq Source

Arguments

:: (Ord α, Show α) 
=> Text

configuration property name that is used in the error message

-> α

a upper bound for the configuration value

-> ConfigValidation α λ 

validateGreater Source

Arguments

:: (Ord α, Show α) 
=> Text

configuration property name that is used in the error message

-> α

a strict lower bound for the configuration value

-> ConfigValidation α λ 

validateGreaterEq Source

Arguments

:: (Ord α, Show α) 
=> Text

configuration property name that is used in the error message

-> α

a lower bound for the configuration value

-> ConfigValidation α λ 

validateRange Source

Arguments

:: (Ord α, Show α) 
=> Text

configuration property name that is used in the error message

-> (α, α)

the valid range for the configuration value

-> ConfigValidation α λ