propellor-5.13: property-based host configuration management in haskell

Safe Haskell | None
Language | Haskell2010

Propellor.Types.Info

Synopsis

- newtype Info = Info [InfoEntry]
- data InfoEntry where
  - InfoEntry :: (IsInfo v, Typeable v) => v -> InfoEntry
- class (Typeable v, Monoid v, Show v) => IsInfo v where
  - propagateInfo :: v -> PropagateInfo
- data PropagateInfo
  - = PropagateInfo Bool
  - | PropagatePrivData
- addInfo :: IsInfo v => Info -> v -> Info
- toInfo :: IsInfo v => v -> Info
- fromInfo :: IsInfo v => Info -> v
- mapInfo :: IsInfo v => (v -> v) -> Info -> Info
- data InfoVal v
  - = NoInfoVal
  - | InfoVal v
- fromInfoVal :: InfoVal v -> Maybe v
- class Typeable (a :: k)

# Documentation

newtype Info Source #

Information about a Host, which can be provided by its properties.

Many different types of data can be contained in the same Info value at the same time. See `toInfo` and `fromInfo`.

Constructors

Info [InfoEntry] |

#### Instances

Instances details

Show Info Source # |
Instance details Defined in Propellor.Types.Info Methods showsPrec :: Int -> Info -> ShowS show :: Info -> String showList :: [Info] -> ShowS
Semigroup Info Source # |
Instance details Defined in Propellor.Types.Info Methods (<>) :: Info -> Info -> Info # sconcat :: NonEmpty Info -> Info stimes :: Integral b => b -> Info -> Info
Monoid Info Source # |
Instance details Defined in Propellor.Types.Info Methods mempty :: Info # mappend :: Info -> Info -> Info # mconcat :: [Info] -> Info #

data InfoEntry where Source #

Constructors

InfoEntry :: (IsInfo v, Typeable v) => v -> InfoEntry |

#### Instances

Instances details

Show InfoEntry Source # |
Instance details Defined in Propellor.Types.Info Methods showsPrec :: Int -> InfoEntry -> ShowS show :: InfoEntry -> String showList :: [InfoEntry] -> ShowS

class (Typeable v, Monoid v, Show v) => IsInfo v where Source #

Values stored in Info must be members of this class.

This is used to avoid accidentially using other data types as info, especially type aliases which coud easily lead to bugs. We want a little bit of dynamic types here, but not too far..

Methods

propagateInfo :: v -> PropagateInfo Source #

Should this info be propagated out of a container to its Host?

#### Instances

Instances details

IsInfo NamedConfMap Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: NamedConfMap -> PropagateInfo Source #
IsInfo DnsInfoUnpropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: DnsInfoUnpropagated -> PropagateInfo Source #
IsInfo DnsInfoPropagated Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: DnsInfoPropagated -> PropagateInfo Source #
IsInfo AliasesInfo Source # |
Instance details Defined in Propellor.Types.Dns Methods propagateInfo :: AliasesInfo -> PropagateInfo Source #
IsInfo DockerInfo Source # |
Instance details Defined in Propellor.Types.Docker Methods propagateInfo :: DockerInfo -> PropagateInfo Source #
IsInfo ChrootInfo Source # |
Instance details Defined in Propellor.Types.Chroot Methods propagateInfo :: ChrootInfo -> PropagateInfo Source #
IsInfo PrivInfo Source # |
Instance details Defined in Propellor.PrivData Methods propagateInfo :: PrivInfo -> PropagateInfo Source #
IsInfo PkgUpgrade Source # |
Instance details Defined in Propellor.Property.FreeBSD.Pkg Methods propagateInfo :: PkgUpgrade -> PropagateInfo Source #
IsInfo PkgUpdate Source # |
Instance details Defined in Propellor.Property.FreeBSD.Pkg Methods propagateInfo :: PkgUpdate -> PropagateInfo Source #
IsInfo PoudriereConfigured Source # |
Instance details Defined in Propellor.Property.FreeBSD.Poudriere Methods propagateInfo :: PoudriereConfigured -> PropagateInfo Source #
IsInfo PartInfo Source # |
Instance details Defined in Propellor.Property.DiskImage.PartSpec Methods propagateInfo :: PartInfo -> PropagateInfo Source #
IsInfo [ContainerCapability] Source # | A [ContainerCapability] can be used as Info. It does not propagate out to the Host. When not in a container, the Info value will be [].
Instance details Defined in Propellor.Types.Container Methods propagateInfo :: [ContainerCapability] -> PropagateInfo Source #
IsInfo [BootloaderInstalled] Source # |
Instance details Defined in Propellor.Types.Bootloader Methods propagateInfo :: [BootloaderInstalled] -> PropagateInfo Source #
(Typeable v, Show v) => IsInfo (InfoVal v) Source # |
Instance details Defined in Propellor.Types.Info Methods propagateInfo :: InfoVal v -> PropagateInfo Source #

data PropagateInfo Source #

Constructors

PropagateInfo Bool |
PropagatePrivData | Info about PrivData generally will be propigated even in cases where other Info is not, so it treated specially.

addInfo :: IsInfo v => Info -> v -> Info Source #

Any value in the `IsInfo` type class can be added to an Info.

toInfo :: IsInfo v => v -> Info Source #

Converts any value in the `IsInfo` type class into an Info, which is otherwise empty.

fromInfo :: IsInfo v => Info -> v Source #

Extracts a value from an Info.

mapInfo :: IsInfo v => (v -> v) -> Info -> Info Source #

Maps a function over all values stored in the Info that are of the appropriate type.

data InfoVal v Source #

Use this to put a value in Info that is not a monoid. The last value set will be used. This info does not propagate out of a container.

Constructors

NoInfoVal |
InfoVal v |

#### Instances

Instances details

Show v => Show (InfoVal v) Source # |
Instance details Defined in Propellor.Types.Info Methods showsPrec :: Int -> InfoVal v -> ShowS show :: InfoVal v -> String showList :: [InfoVal v] -> ShowS
Semigroup (InfoVal v) Source # |
Instance details Defined in Propellor.Types.Info Methods (<>) :: InfoVal v -> InfoVal v -> InfoVal v # sconcat :: NonEmpty (InfoVal v) -> InfoVal v stimes :: Integral b => b -> InfoVal v -> InfoVal v
Monoid (InfoVal v) Source # |
Instance details Defined in Propellor.Types.Info Methods mempty :: InfoVal v # mappend :: InfoVal v -> InfoVal v -> InfoVal v # mconcat :: [InfoVal v] -> InfoVal v #
(Typeable v, Show v) => IsInfo (InfoVal v) Source # |
Instance details Defined in Propellor.Types.Info Methods propagateInfo :: InfoVal v -> PropagateInfo Source #

fromInfoVal :: InfoVal v -> Maybe v Source #

class Typeable (a :: k) #

Minimal complete definition

typeRep#