Safe Haskell | Safe-Infered |
---|
These are the function and data types that are used to define the Puppet native types.
- type PuppetTypeName = String
- type PuppetTypeValidate = RResource -> Either String RResource
- data PuppetTypeMethods = PuppetTypeMethods {}
- faketype :: PuppetTypeName -> (PuppetTypeName, PuppetTypeMethods)
- defaulttype :: PuppetTypeName -> (PuppetTypeName, PuppetTypeMethods)
- defaultValidate :: Set String -> PuppetTypeValidate
- checkParameterList :: Set String -> PuppetTypeValidate
- addDefaults :: PuppetTypeValidate
- runarray :: String -> (String -> ResolvedValue -> PuppetTypeValidate) -> PuppetTypeValidate
- string :: String -> PuppetTypeValidate
- strings :: String -> PuppetTypeValidate
- string' :: String -> ResolvedValue -> PuppetTypeValidate
- values :: [String] -> String -> PuppetTypeValidate
- defaultvalue :: String -> String -> PuppetTypeValidate
- insertparam :: RResource -> String -> ResolvedValue -> RResource
- integer :: String -> PuppetTypeValidate
- integers :: String -> PuppetTypeValidate
- integer'' :: String -> ResolvedValue -> PuppetTypeValidate
- nameval :: String -> PuppetTypeValidate
- mandatory :: String -> PuppetTypeValidate
- parameterFunctions :: [(String, [String -> PuppetTypeValidate])] -> PuppetTypeValidate
- fullyQualified :: String -> PuppetTypeValidate
- fullyQualifieds :: String -> PuppetTypeValidate
- fullyQualified' :: String -> ResolvedValue -> PuppetTypeValidate
- rarray :: String -> PuppetTypeValidate
- ipaddr :: String -> PuppetTypeValidate
- checkipv4 :: String -> Int -> Bool
- inrange :: Integer -> Integer -> String -> PuppetTypeValidate
Documentation
type PuppetTypeName = StringSource
type PuppetTypeValidate = RResource -> Either String RResourceSource
This is a function type than can be bound. It is the type of all subsequent validators.
data PuppetTypeMethods Source
defaultValidate :: Set String -> PuppetTypeValidateSource
This helper will validate resources given a list of fields. It will run
checkParameterList
and then addDefaults
.
checkParameterList :: Set String -> PuppetTypeValidateSource
This validator checks that no unknown parameters have been set (except metaparameters)
addDefaults :: PuppetTypeValidateSource
This validator always accept the resources, but add the default parameters (such as title and name).
runarray :: String -> (String -> ResolvedValue -> PuppetTypeValidate) -> PuppetTypeValidateSource
Helper function that runs a validor on a ResolvedArray
string :: String -> PuppetTypeValidateSource
This checks that a given parameter is a string. If it is a ResolvedInt
or
ResolvedBool
it will convert them to strings.
values :: [String] -> String -> PuppetTypeValidateSource
Makes sure that the parameter, if defined, has a value among this list.
defaultvalue :: String -> String -> PuppetTypeValidateSource
This fills the default values of unset parameters.
insertparam :: RResource -> String -> ResolvedValue -> RResourceSource
integer :: String -> PuppetTypeValidateSource
Checks that a given parameter, if set, is a ResolvedInt
. If it is a
ResolvedString
it will attempt to parse it.
nameval :: String -> PuppetTypeValidateSource
Copies the name value into this if this is not set.
mandatory :: String -> PuppetTypeValidateSource
Checks that a given parameter is set.
parameterFunctions :: [(String, [String -> PuppetTypeValidate])] -> PuppetTypeValidateSource
Helper that takes a list of stuff and will generate a validator.