Current section
Files
Jump to
Current section
Files
lib/ua_inspector.ex
defmodule UAInspector do
@moduledoc """
UAInspector Application
"""
use Application
alias UAInspector.Config
alias UAInspector.Databases
alias UAInspector.ShortCodeMaps
def start(_type, _args) do
import Supervisor.Spec
options = [ strategy: :one_for_one, name: UAInspector.Supervisor ]
children = [
worker(Databases, []),
worker(ShortCodeMaps, []),
UAInspector.Pool.child_spec
]
sup = Supervisor.start_link(children, options)
:ok = Config.database_path |> Databases.load()
:ok = Config.database_path |> ShortCodeMaps.load()
sup
end
@doc """
Parses a user agent.
"""
@spec parse(String.t) :: map
defdelegate parse(ua), to: UAInspector.Pool
end