Safe Haskell | None |
---|---|
Language | Haskell2010 |
Building-block methods to build a command-line tool able to inspect and turnup/turndown DevOps.
Synopsis
- data Method
- = TurnUp Concurrency
- | TurnDown Concurrency
- | Upkeep
- | Dot
- | CheckDot
- | List
- data Concurrency
- applyMethod :: [Forest PreOp -> Forest PreOp] -> Forest PreOp -> Method -> IO ()
- simpleMain :: DevOp env a -> [Forest PreOp -> Forest PreOp] -> [String] -> env -> IO ()
- type SelfPath = FilePath
- type ForestOptimization = Forest PreOp -> Forest PreOp
- data App env node = App {
- _parseArgs :: [String] -> (node, Method)
- _revParse :: node -> Method -> [String]
- _target :: node -> SelfPath -> (node -> Method -> [String]) -> DevOp env ()
- _opts :: [ForestOptimization]
- _retrieveEnv :: node -> IO env
- appMain :: App env a -> IO ()
- appMethod :: String -> Method
- methodArg :: Method -> String
- getDependenciesOnly :: env -> DevOp env a -> Forest PreOp
- graphize :: Forest PreOp -> GraphData PreOp OpUniqueId
- opClosureFromB64 :: (Typeable env, Typeable a) => ByteString -> Closure (DevOp env a)
- opClosureToB64 :: (Typeable env, Typeable a) => Closure (DevOp env a) -> ByteString
Documentation
Building main programs
:: DevOp env a | an operation |
-> [Forest PreOp -> Forest PreOp] | forest transformations to optimize the resulting graph |
-> [String] | args |
-> env | environment |
-> IO () |
Simple main function for a single operation.
You should use this simpleMain
for simple configuration binaries, more
involved architectures shoul almost need a App
or appMain
.
type SelfPath = FilePath Source #
A FilePath corresponding to the file with the currently-executing binary.
A builder for app that can be useful for defining an infrastructure as a recursive structure where the "main entry point" of the recursion is the binary itself.
App | |
|
Utilities
getDependenciesOnly :: env -> DevOp env a -> Forest PreOp Source #
Evaluates the dependencies of a DevOp, discarding any result.
graphize :: Forest PreOp -> GraphData PreOp OpUniqueId Source #
Builds a Graph from dependencies represented as a Forest.
Nodes with a same hash in the Forest will correspond to the same node in the graph, hence, it's possible to create cycles by mistake if two nodes have a same hash by mistake (this is possible if the hash does not depend on all arguments to a DevOp).
opClosureFromB64 :: (Typeable env, Typeable a) => ByteString -> Closure (DevOp env a) Source #
Helper to deal with App when you want to use Closures as a serialization/deserialization mechanism.
You will likely add opClosureFromB64
in the _parseArgs
field of your
App
and opClosureToB64
in the _revParse
field.
opClosureToB64 :: (Typeable env, Typeable a) => Closure (DevOp env a) -> ByteString Source #
Dual to opClosureFromB64
.