Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 968 Bytes

File metadata and controls

43 lines (34 loc) · 968 Bytes

Share

Share is a packege to manage Node and can share files between Node in the same network.

Installation

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

Usage

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")
Made with ❤️ by darkcoder.