language-puppet-1.3.8.1: Tools to parse and evaluate the Puppet DSL.

Safe HaskellNone
LanguageHaskell98

Puppet.Interpreter.Types

Contents

Synopsis

Record & lenses

data RIdentifier #

Constructors

RIdentifier !Text !Text 

Instances

Eq RIdentifier # 
Ord RIdentifier # 
Show RIdentifier # 
Generic RIdentifier # 

Associated Types

type Rep RIdentifier :: * -> * #

Hashable RIdentifier # 
ToJSON RIdentifier # 
FromJSON RIdentifier # 
HasRIdentifier RIdentifier # 
type Rep RIdentifier # 
type Rep RIdentifier = D1 (MetaData "RIdentifier" "Puppet.Interpreter.Types" "language-puppet-1.3.8.1-8QqTcwoaqzC7L0SDySpOdh" False) (C1 (MetaCons "RIdentifier" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_itype") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_iname") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Text))))

data ScopeEnteringContext #

Constructors

SENormal 
SEChild !Text

We enter the scope as the child of another class

SEParent !Text

We enter the scope as the parent of another class

class HasIoMethods c m | c -> m where #

Minimal complete definition

ioMethods

data IoMethods m #

Constructors

IoMethods (m [String]) ([Text] -> m (Either String Text)) (String -> m ()) 

Operational instructions

data InterpreterInstr a where #

Constructors

GetNativeTypes :: InterpreterInstr (Container NativeTypeMethods) 
GetStatement :: TopLevelType -> Text -> InterpreterInstr Statement 
ComputeTemplate :: Either Text Text -> InterpreterState -> InterpreterInstr Text 
ExternalFunction :: Text -> [PValue] -> InterpreterInstr PValue 
GetNodeName :: InterpreterInstr Text 
HieraQuery :: Container Text -> Text -> HieraQueryType -> InterpreterInstr (Maybe PValue) 
GetCurrentCallStack :: InterpreterInstr [String] 
IsIgnoredModule :: Text -> InterpreterInstr Bool 
IsExternalModule :: Text -> InterpreterInstr Bool 
IsStrict :: InterpreterInstr Bool 
PuppetPaths :: InterpreterInstr PuppetDirPaths 
ErrorThrow :: PrettyError -> InterpreterInstr a 
ErrorCatch :: InterpreterMonad a -> (PrettyError -> InterpreterMonad a) -> InterpreterInstr a 
WriterTell :: InterpreterWriter -> InterpreterInstr () 
WriterPass :: InterpreterMonad (a, InterpreterWriter -> InterpreterWriter) -> InterpreterInstr a 
WriterListen :: InterpreterMonad a -> InterpreterInstr (a, InterpreterWriter) 
PDBInformation :: InterpreterInstr Doc 
PDBReplaceCatalog :: WireCatalog -> InterpreterInstr () 
PDBReplaceFacts :: [(NodeName, Facts)] -> InterpreterInstr () 
PDBDeactivateNode :: NodeName -> InterpreterInstr () 
PDBGetFacts :: Query FactField -> InterpreterInstr [FactInfo] 
PDBGetResources :: Query ResourceField -> InterpreterInstr [Resource] 
PDBGetNodes :: Query NodeField -> InterpreterInstr [NodeInfo] 
PDBCommitDB :: InterpreterInstr () 
PDBGetResourcesOfNode :: NodeName -> Query ResourceField -> InterpreterInstr [Resource] 
ReadFile :: [Text] -> InterpreterInstr Text 
TraceEvent :: String -> InterpreterInstr () 

class HasInterpreterReader c m | c -> m where #

Minimal complete definition

interpreterReader

data InterpreterState #

Sum types

PValue

Misc

data CurContainerDesc #

Constructors

ContRoot

Contained at node or root level

ContClass !Text

Contained in a class

ContDefine !Text !Text !PPosition

Contained in a define, along with the position where this define was ... defined

ContImported !CurContainerDesc

Dummy container for imported resources, so that we know we must update the nodename

ContImport !NodeName !CurContainerDesc

This one is used when finalizing imported resources, and contains the current node name

Instances

Eq CurContainerDesc # 
Ord CurContainerDesc # 
Show CurContainerDesc # 
Generic CurContainerDesc # 
type Rep CurContainerDesc # 

data Query a #

Pretty straightforward way to define the various PuppetDB queries

Constructors

QEqual a Text 
QG a Integer 
QL a Integer 
QGE a Integer 
QLE a Integer 
QMatch Text Text 
QAnd [Query a] 
QOr [Query a] 
QNot (Query a) 
QEmpty 

data ModifierType #

Constructors

ModifierCollector

For collectors, optional resources

ModifierMustMatch

For stuff like realize

data Strictness #

The intepreter can run in two modes : a strict mode (recommended), and a permissive mode. The permissive mode let known antipatterns work with the interpreter.

Constructors

Strict 
Permissive 

data HieraQueryType #

The different kind of hiera queries

Constructors

Priority

standard hiera query

ArrayMerge

hiera_array

HashMerge

hiera_hash

data TopLevelType #

This type is used to differenciate the distinct top level types that are exposed by the DSL.

Constructors

TopNode

This is for node entries.

TopDefine

This is for defines.

TopClass

This is for classes.

Instances

Eq TopLevelType # 
Generic TopLevelType # 

Associated Types

type Rep TopLevelType :: * -> * #

Hashable TopLevelType # 
type Rep TopLevelType # 
type Rep TopLevelType = D1 (MetaData "TopLevelType" "Puppet.Interpreter.Types" "language-puppet-1.3.8.1-8QqTcwoaqzC7L0SDySpOdh" False) ((:+:) (C1 (MetaCons "TopNode" PrefixI False) U1) ((:+:) (C1 (MetaCons "TopDefine" PrefixI False) U1) (C1 (MetaCons "TopClass" PrefixI False) U1)))

data ResRefOverride #

From the evaluation of Resource Override Declaration

data OverrideType #

Constructors

CantOverride

Overriding forbidden, will throw an error

Replace

Can silently replace

CantReplace

Silently ignore errors

AppendAttribute

Can append values

data ClassIncludeType #

Puppet has two main ways to declare classes: include-like and resource-like https://docs.puppetlabs.com/puppet/latest/reference/lang_classes.html#include-like-vs-resource-like

Constructors

ClassIncludeLike

using the include or contain function

ClassResourceLike

resource like declaration

PuppetDB

newtype & synonym

type NodeName = Text #

type HieraQueryFunc m #

Arguments

 = Container Text

All the variables that Hiera can interpolate, the top level ones being prefixed with ::

-> Text

The query

-> HieraQueryType 
-> m (Either PrettyError (Maybe PValue)) 

The type of the Hiera API function

type Scope = Text #

Classes

class Monad m => MonadThrowPos m where #

Minimal complete definition

throwPosError

Methods

throwPosError :: Doc -> m a #

class Monad m => MonadError e m | m -> e where #

The strategy of combining computations that can throw exceptions by bypassing bound functions from the point an exception is thrown to the point that it is handled.

Is parameterized over the type of error information and the monad type constructor. It is common to use Either String as the monad type constructor for an error monad in which error descriptions take the form of strings. In that case and many other common cases the resulting monad is already defined as an instance of the MonadError class. You can also define your own error type and/or use a monad type constructor other than Either String or Either IOError. In these cases you will have to explicitly define instances of the Error and/or MonadError classes.

Minimal complete definition

throwError, catchError

Methods

throwError :: e -> m a #

Is used within a monadic computation to begin exception processing.

catchError :: m a -> (e -> m a) -> m a #

A handler function to handle previous errors and return to normal execution. A common idiom is:

do { action1; action2; action3 } `catchError` handler

where the action functions can call throwError. Note that handler and the do-block must have the same return type.

Instances

MonadError IOException IO 

Methods

throwError :: IOException -> IO a #

catchError :: IO a -> (IOException -> IO a) -> IO a #

MonadError ServantError ClientM 
MonadError PrettyError InterpreterMonad # 
MonadError e m => MonadError e (MaybeT m) 

Methods

throwError :: e -> MaybeT m a #

catchError :: MaybeT m a -> (e -> MaybeT m a) -> MaybeT m a #

MonadError e m => MonadError e (ListT m) 

Methods

throwError :: e -> ListT m a #

catchError :: ListT m a -> (e -> ListT m a) -> ListT m a #

MonadError e (Either e) 

Methods

throwError :: e -> Either e a #

catchError :: Either e a -> (e -> Either e a) -> Either e a #

MonadError e m => MonadError e (IterT m) 

Methods

throwError :: e -> IterT m a #

catchError :: IterT m a -> (e -> IterT m a) -> IterT m a #

MonadError e m => MonadError e (ResourceT m) 

Methods

throwError :: e -> ResourceT m a #

catchError :: ResourceT m a -> (e -> ResourceT m a) -> ResourceT m a #

Monad m => MonadError e (ExceptT e m) 

Methods

throwError :: e -> ExceptT e m a #

catchError :: ExceptT e m a -> (e -> ExceptT e m a) -> ExceptT e m a #

(Monoid w, MonadError e m) => MonadError e (WriterT w m) 

Methods

throwError :: e -> WriterT w m a #

catchError :: WriterT w m a -> (e -> WriterT w m a) -> WriterT w m a #

(Monoid w, MonadError e m) => MonadError e (WriterT w m) 

Methods

throwError :: e -> WriterT w m a #

catchError :: WriterT w m a -> (e -> WriterT w m a) -> WriterT w m a #

MonadError e m => MonadError e (StateT s m) 

Methods

throwError :: e -> StateT s m a #

catchError :: StateT s m a -> (e -> StateT s m a) -> StateT s m a #

MonadError e m => MonadError e (StateT s m) 

Methods

throwError :: e -> StateT s m a #

catchError :: StateT s m a -> (e -> StateT s m a) -> StateT s m a #

MonadError e m => MonadError e (IdentityT * m) 

Methods

throwError :: e -> IdentityT * m a #

catchError :: IdentityT * m a -> (e -> IdentityT * m a) -> IdentityT * m a #

(Monad m, Error e) => MonadError e (ErrorT e m) 

Methods

throwError :: e -> ErrorT e m a #

catchError :: ErrorT e m a -> (e -> ErrorT e m a) -> ErrorT e m a #

(Functor f, MonadError e m) => MonadError e (FreeT f m) 

Methods

throwError :: e -> FreeT f m a #

catchError :: FreeT f m a -> (e -> FreeT f m a) -> FreeT f m a #

MonadError e m => MonadError e (ReaderT * r m) 

Methods

throwError :: e -> ReaderT * r m a #

catchError :: ReaderT * r m a -> (e -> ReaderT * r m a) -> ReaderT * r m a #

(ErrorComponent e, Stream s, MonadError e' m) => MonadError e' (ParsecT e s m) 

Methods

throwError :: e' -> ParsecT e s m a #

catchError :: ParsecT e s m a -> (e' -> ParsecT e s m a) -> ParsecT e s m a #

MonadError e m => MonadError e (ConduitM i o m) 

Methods

throwError :: e -> ConduitM i o m a #

catchError :: ConduitM i o m a -> (e -> ConduitM i o m a) -> ConduitM i o m a #

MonadError e m => MonadError e (ParsecT s u m) 

Methods

throwError :: e -> ParsecT s u m a #

catchError :: ParsecT s u m a -> (e -> ParsecT s u m a) -> ParsecT s u m a #

(Monoid w, MonadError e m) => MonadError e (RWST r w s m) 

Methods

throwError :: e -> RWST r w s m a #

catchError :: RWST r w s m a -> (e -> RWST r w s m a) -> RWST r w s m a #

(Monoid w, MonadError e m) => MonadError e (RWST r w s m) 

Methods

throwError :: e -> RWST r w s m a #

catchError :: RWST r w s m a -> (e -> RWST r w s m a) -> RWST r w s m a #

MonadError e m => MonadError e (Pipe l i o u m) 

Methods

throwError :: e -> Pipe l i o u m a #

catchError :: Pipe l i o u m a -> (e -> Pipe l i o u m a) -> Pipe l i o u m a #

definitions