Safe Haskell | None |
---|
- type PuppetTypeName = Text
- type PuppetTypeValidate = RResource -> Either String RResource
- data PuppetTypeMethods = PuppetTypeMethods {}
- type Catalog = [CResource]
- type Facts = Map Text ResolvedValue
- data LinkType
- = RNotify
- | RRequire
- | RBefore
- | RSubscribe
- type LinkInfo = (LinkType, RelUpdateType, SourcePos, [[ScopeName]])
- data ResolvedValue
- = ResolvedString !Text
- | ResolvedRegexp !Text
- | ResolvedInt !Integer
- | ResolvedDouble !Double
- | ResolvedBool !Bool
- | ResolvedRReference !Text !ResolvedValue
- | ResolvedArray ![ResolvedValue]
- | ResolvedHash ![(Text, ResolvedValue)]
- | ResolvedUndefined
- parseResourceReference :: Text -> Maybe ResolvedValue
- type GeneralValue = Either Expression ResolvedValue
- type GeneralString = Either Expression Text
- data CResource = CResource {
- crid :: !Int
- crname :: !GeneralString
- crtype :: !Text
- crparams :: !(Map GeneralString GeneralValue)
- crvirtuality :: !Virtuality
- crscope :: ![[ScopeName]]
- pos :: !SourcePos
- json2puppet :: FromJSON a => Value -> Either String a
- type ResIdentifier = (Text, Text)
- type Relation = (LinkType, ResIdentifier)
- data RResource = RResource {}
- rr2json :: Text -> RResource -> Value
- type FinalCatalog = Map ResIdentifier RResource
- type ScopeName = Text
- data RelUpdateType
- data ResDefaults
- data ScopeState = ScopeState {
- curScope :: ![[ScopeName]]
- curVariables :: !(Map Text (GeneralValue, SourcePos))
- curClasses :: !(Map Text SourcePos)
- curDefaults :: !(Map [ScopeName] [ResDefaults])
- curResId :: !Int
- curPos :: !SourcePos
- nestedtoplevels :: !(Map (TopLevelType, Text) Statement)
- getStatementsFunction :: TopLevelType -> Text -> IO (Either String Statement)
- getWarnings :: ![Text]
- curCollect :: ![(CResource -> CatalogMonad Bool, Map GeneralString GeneralValue, Maybe Query)]
- unresolvedRels :: ![([(LinkType, GeneralValue, GeneralValue)], (Text, GeneralString), RelUpdateType, SourcePos, [[ScopeName]])]
- computeTemplateFunction :: Either Text Text -> Text -> Map Text GeneralValue -> IO (Either String Text)
- puppetDBFunction :: Text -> Query -> IO (Either String Value)
- luaState :: Maybe LuaState
- userFunctions :: !(Set Text)
- nativeTypes :: !(Map PuppetTypeName PuppetTypeMethods)
- definedResources :: !(Map ResIdentifier SourcePos)
- currentDependencyStack :: [ResIdentifier]
- type CatalogMonad = ErrorT Text (StateT ScopeState IO)
- type EdgeMap = Map (ResIdentifier, ResIdentifier) LinkInfo
- generalizeValueE :: Expression -> GeneralValue
- generalizeValueR :: ResolvedValue -> GeneralValue
- generalizeStringE :: Expression -> GeneralString
- generalizeStringS :: Text -> GeneralString
- metaparameters :: Set Text
- getPos :: ErrorT Text (StateT ScopeState IO) SourcePos
- modifyScope :: ([[ScopeName]] -> [[ScopeName]]) -> ScopeState -> ScopeState
- modifyDeps :: ([ResIdentifier] -> [ResIdentifier]) -> ScopeState -> ScopeState
- modifyVariables :: (Map Text (GeneralValue, SourcePos) -> Map Text (GeneralValue, SourcePos)) -> ScopeState -> ScopeState
- modifyClasses :: (Map Text SourcePos -> Map Text SourcePos) -> ScopeState -> ScopeState
- incrementResId :: ScopeState -> ScopeState
- setStatePos :: SourcePos -> ScopeState -> ScopeState
- pushWarning :: Text -> ScopeState -> ScopeState
- pushCollect :: (CResource -> CatalogMonad Bool, Map GeneralString GeneralValue, Maybe Query) -> ScopeState -> ScopeState
- pushUnresRel :: ([(LinkType, GeneralValue, GeneralValue)], (Text, GeneralString), RelUpdateType, SourcePos, [[ScopeName]]) -> ScopeState -> ScopeState
- addDefinedResource :: MonadState ScopeState m => ResIdentifier -> SourcePos -> m ()
- saveVariables :: MonadState ScopeState m => Map Text (GeneralValue, SourcePos) -> m ()
- showScope :: [[ScopeName]] -> Text
- throwPosError :: Text -> CatalogMonad a
- addAlias :: Text -> RResource -> Either String RResource
- insertparam :: RResource -> Text -> ResolvedValue -> RResource
Documentation
type PuppetTypeName = TextSource
Types for the native type system.
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
type Facts = Map Text ResolvedValueSource
Relationship link type.
data ResolvedValue Source
The list of resolved values that are used to define everything in a
FinalCatalog
and in the resolved parts of a Catalog
. They are to be
compared with the Value
s.
type GeneralValue = Either Expression ResolvedValueSource
This type holds a value that is either from the ASL or fully resolved.
type GeneralString = Either Expression TextSource
This type holds a value that is either from the ASL or a fully resolved String.
This describes the resources before the final resolution. This is required
as they must somehow be collected while the Statement
s are interpreted, but
the necessary Expression
s are not yet available. This is because in Puppet the
Statement
order should not alter the catalog's content.
The relations are not stored here, as they are pushed into a separate internal data structure by the interpreter.
CResource | |
|
json2puppet :: FromJSON a => Value -> Either String aSource
Used for puppetDB queries, converting values to CResources
type ResIdentifier = (Text, Text)Source
Resource identifier, made of a type, name pair.
type Relation = (LinkType, ResIdentifier)Source
Resource relation, made of a LinkType
, ResIdentifier
pair.
This is a fully resolved resource that will be used in the FinalCatalog
.
RResource | |
|
data RelUpdateType Source
Type of update/override, so they can be applied in the correct order. This part is probably not behaving like vanilla puppet, as it turns out this are many fairly acceptable behaviours and the correct one is not documented.
data ResDefaults Source
A data type to hold defaults values
data ScopeState Source
The most important data structure for the interpreter. It stores its internal state.
ScopeState | |
|
type CatalogMonad = ErrorT Text (StateT ScopeState IO)Source
The monad all the interpreter lives in. It is ErrorT
with a state.
type EdgeMap = Map (ResIdentifier, ResIdentifier) LinkInfoSource
This is the map of all edges associated with the FinalCatalog
.
The key is (source, target).
metaparameters :: Set TextSource
This is the set of meta parameters
modifyScope :: ([[ScopeName]] -> [[ScopeName]]) -> ScopeState -> ScopeStateSource
modifyDeps :: ([ResIdentifier] -> [ResIdentifier]) -> ScopeState -> ScopeStateSource
modifyVariables :: (Map Text (GeneralValue, SourcePos) -> Map Text (GeneralValue, SourcePos)) -> ScopeState -> ScopeStateSource
modifyClasses :: (Map Text SourcePos -> Map Text SourcePos) -> ScopeState -> ScopeStateSource
setStatePos :: SourcePos -> ScopeState -> ScopeStateSource
pushWarning :: Text -> ScopeState -> ScopeStateSource
pushCollect :: (CResource -> CatalogMonad Bool, Map GeneralString GeneralValue, Maybe Query) -> ScopeState -> ScopeStateSource
pushUnresRel :: ([(LinkType, GeneralValue, GeneralValue)], (Text, GeneralString), RelUpdateType, SourcePos, [[ScopeName]]) -> ScopeState -> ScopeStateSource
addDefinedResource :: MonadState ScopeState m => ResIdentifier -> SourcePos -> m ()Source
saveVariables :: MonadState ScopeState m => Map Text (GeneralValue, SourcePos) -> m ()Source
throwPosError :: Text -> CatalogMonad aSource
insertparam :: RResource -> Text -> ResolvedValue -> RResourceSource