blueprint v0.3.0 Blueprint.Application.Module
A struct containing contents from a BEAM module useful for inspecting.
By default messages will only be found when servers explicitly
match. This however can be extended by providing custom server
matching expressions in the config under the :servers
key.
## Server Match Expressions
Server match expression should take the form of { match, server }
,
where match
is the expression to be matched with (against the
function calls server arg), and server
is the resulting target
server.
The :servers
key should have a string of the the list of server
match expressions.
An example of this could be:
config :blueprint,
servers: ~S([
{ { :tuple, _, [{ :atom, _, s }, { :atom, _, :"foo@127.0.0.1" }] }, s }, # match against a named node, and return whatever server name is bound to 's'
{ { :call, _, { :atom, _, :get_server }, [] }, Foo }, # match against a get_server/0 function and return Foo as the server
{ _, Bar } # match any argument and return Bar as the server
])
Link to this section Summary
Link to this section Types
Link to this type
t()
t() :: %Blueprint.Application.Module{beam: binary(), messages: [Blueprint.Application.Module.Message.t()], name: atom(), path: String.t(), server: server()}
Link to this section Functions
Load the contents of a module at the given path.
iex> Blueprint.Application.Module.new(Path.join(Mix.Project.app_path(), "ebin/Elixir.Blueprint.Application.Module.beam")).name
Blueprint.Application.Module