IPFS v0.1.4 IPFS View Source

Provides abstration allowing to access IPFS nodes with low effort.

Link to this section Summary

Types

Identifies content on the IPFS network using a multihash string

Represents an absolute filename existing on disk

Represents an endpoint path to hit

Models the result of most of the functions accessible in this module

t()

Represents the endpoint to hit. Required as the first argument of most functions

Functions

High level function allowing to perform GET requests to the node

High level function allowing to send file contents to the node

Link to this section Types

Identifies content on the IPFS network using a multihash string.

Link to this type filename() View Source
filename() :: String.t()

Represents an absolute filename existing on disk.

Represents an endpoint path to hit.

Link to this type result() View Source
result() :: {:ok, any()} | {:error, any()}

Models the result of most of the functions accessible in this module.

Link to this type t() View Source
t() :: %IPFS{
  base: path() | nil,
  host: String.t(),
  port: pos_integer(),
  scheme: String.t()
}

Represents the endpoint to hit. Required as the first argument of most functions.

Link to this section Functions

Link to this function get(conn, path, params \\ []) View Source
get(t(), path(), keyword()) :: result()

High level function allowing to perform GET requests to the node.

A path has to be provided, along with an optional list of params that are dependent on the endpoint that will get hit.

Link to this function post_file(conn, path, filename, params \\ []) View Source
post_file(t(), path(), filename(), keyword()) :: result()

High level function allowing to send file contents to the node.

A path has to be specified along with the filename to be sent. Also, a list of params can be optionally sent.