Vik (Vik v0.0.1-rc1)
View SourceThe public API all Shards have access to; imported by default.
Summary
Types
Functions
Can be used to make modules available to other shards
using include/1
.
Examples
defmodule Hello do
def world do
"hewwo world :3"
end
end
export Hello
Exposes the given function or module as a publicly accessible API endpoint.
Examples
def call(conn, []) do
send_resp(conn, 200, "hewwo world :3")
end
expose call: 2
def call(conn, ~m{name}s, []) do
send_resp(conn, 200, "hewwo, #{name}!)
end
expose call: 3
Can be used to automatically alias modules defined by another shard in the current shard.
The other module will be compiled before the calling module. Cyclic dependencies will crash the system. So maybe don't do that? thx :)
Examples
include "foo"
Foo.bar()