Share is a packege to manage Node and can share files between Node in the same network.
If available in Hex, the package can be installed
by adding share
to your list of dependencies in mix.exs
:
def deps do
[
{:share, "~> 0.1.0"}
]
end
Creation of a Node:
iex> {:ok, node_info} = Share.Node.create(name: "test", secret: :secret)
{:ok,
%Share.Node{
hostname: "localhost", # Your hostname
name: "test",
pid: #PID<x.x.x>,
secret: :secret
}}
Connect with other Node:
iex> {:ok, list_others_nodes} = Share.Node.connect_node(name: "test", hostname: "localhost")
{:ok, [:"test@localhost"]}
Share a file:
iex> :ok = Share.send(to: :"test@localhost", filename: "/path/file")