keter-1.8.2: Web application deployment manager, focusing on Haskell web frameworks
Safe HaskellSafe-Inferred
LanguageHaskell98

Keter.LabelMap

Synopsis

Types

data LabelMap a Source #

A data structure for storing a hierarchical set of domain labels from TLD down, supporting wildcards.

Data structure is mutually recursive with LabelEntry, and each level of the tree supports a static assignment for a hostname such as:

 example.com

Or a wildcard assignment for a hostname such as:

 *.example.com

Or a wildcard assignment with a set of teptions, for example:

 *.example.com
 admin.example.com

And lastly, empty labels are supported so that, of course, an assignment for example.com does not necessarily have any subdomains available. As an example suppose we have the following assigned domains:

         example.com
     foo.example.com
   *.bar.example.com
   *.qux.example.com
 baz.qux.example.com

This will resolve to the following value, with some loose pseudocode notation.

 Static (map)
   'com' -> Unassigned Static (map)
     'example' -> Assigned a (map)
        'foo'  -> Assigned a EmptyLabelMap
        'bar'  -> Unassigned (Wildcard (Assigned a EmptyLabelMap)
        'qux'  -> Unassigned (WildcardExcept (Assigned a (map)))
          'baz' -> Assigned a EmptyLabelMap

Note that the hostname "bar.example.com" is unassigned, only the wildcard was set.

Instances

Instances details
Eq a => Eq (LabelMap a) Source # 
Instance details

Defined in Keter.LabelMap

Methods

(==) :: LabelMap a -> LabelMap a -> Bool #

(/=) :: LabelMap a -> LabelMap a -> Bool #

Show (LabelMap a) Source # 
Instance details

Defined in Keter.LabelMap

Methods

showsPrec :: Int -> LabelMap a -> ShowS #

show :: LabelMap a -> String #

showList :: [LabelMap a] -> ShowS #

Helper functions