heimdall v0.2.2 Heimdall.Marathon.BingeWatch
There’s a Marathon playing, and we’re gonna BingeWatch it.
This module is for handling callback events from Marathon. Given any event it will query all running apps, and rebuild the dynmaic routes based on the labels of each app.
This module is also a plug, traffic from /marathon-callback is
routed to call/2
by Heimdall.Router
Summary
Functions
Builds a route given a map that represents the Marathon config
for an app. The config must have a labels
map, as well as a
heimdall.host
and heimdall.path
in the labels
map
Builds a list of routest given a list of map that represent
the Marathon app configs. It will filter out all of the apps
that do not have a proper Heimdall configuration set up (i.e.
they don’t have a labels with heimdall.host
and
heimdall.path
Converts a string to an elixir module atom. Will throw an argument error if the module does not exist. (There is no need to give a fully qualified erlang module name, just refer to it as you would in elixir)
Functions
Builds a route given a map that represents the Marathon config
for an app. The config must have a labels
map, as well as a
heimdall.host
and heimdall.path
in the labels
map.
heimdall.filters
and heimdall.opts
are optional, they will
default to an empty list and tuple respectively.
Builds a list of routest given a list of map that represent
the Marathon app configs. It will filter out all of the apps
that do not have a proper Heimdall configuration set up (i.e.
they don’t have a labels with heimdall.host
and
heimdall.path
.
Converts a string to an elixir module atom. Will throw an argument error if the module does not exist. (There is no need to give a fully qualified erlang module name, just refer to it as you would in elixir)
Examples
iex>Heimdall.Marathon.BingeWatch.string_to_module("Heimdall.Marathon.BingeWatch")
Heimdall.Marathon.BingeWatch