keter-1.3.5: Web application deployment manager, focusing on Haskell web frameworks

Safe HaskellNone

Keter.LabelMap

Contents

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

Show (LabelMap a) 

Helper functions

lookup :: ByteString -> LabelMap a -> Maybe aSource