summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/Docker.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-21 18:55:33 -0400
committerJoey Hess2014-11-21 18:55:33 -0400
commit6c92f1034f980718cef54cab58a1bcfdbc485f5d (patch)
tree3a2bacdc7d3433b6326c01e9acf3f9d2101e04b3 /src/Propellor/Types/Docker.hs
parent04ea987075b869ea70cf55a193af7f5604ff0561 (diff)
split out info types
Diffstat (limited to 'src/Propellor/Types/Docker.hs')
-rw-r--r--src/Propellor/Types/Docker.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Propellor/Types/Docker.hs b/src/Propellor/Types/Docker.hs
new file mode 100644
index 00000000..42a65923
--- /dev/null
+++ b/src/Propellor/Types/Docker.hs
@@ -0,0 +1,24 @@
+module Propellor.Types.Docker where
+
+import Propellor.Types.OS
+
+import Data.Monoid
+import qualified Data.Map as M
+
+data DockerInfo h = DockerInfo
+ { _dockerRunParams :: [DockerRunParam]
+ , _dockerContainers :: M.Map String h
+ }
+ deriving (Show)
+
+instance Monoid (DockerInfo h) where
+ mempty = DockerInfo mempty mempty
+ mappend old new = DockerInfo
+ { _dockerRunParams = _dockerRunParams old <> _dockerRunParams new
+ , _dockerContainers = M.union (_dockerContainers old) (_dockerContainers new)
+ }
+
+newtype DockerRunParam = DockerRunParam (HostName -> String)
+
+instance Show DockerRunParam where
+ show (DockerRunParam a) = a ""