View Source MyspaceIPFS.Pin (Myspace IPFS v0.1.0)

MyspaceIPFS.Pin is where the pin commands of the IPFS API reside.

Link to this section Summary

Functions

Add an IPFS object to the pinset.

List objects pinned to local storage.

List objects pinned to local storage.

Add a local object to the cluster pinset.

List objects pinned to remote storage.

Remove pins from a remote pinset.

Add a service endpoint to the cluster.

List service endpoints in the cluster.

Remove a service endpoint from the cluster.

Remove an IPFS object from the pinset.

Update a recursive pin to a direct pin.

Verify that recursive pins are complete.

Link to this section Types

@type name() :: MySpaceIPFS.name()
@type okmapped() :: MySpaceIPFS.okmapped()
@type opts() :: MySpaceIPFS.opts()
@type path() :: MySpaceIPFS.path()
@type url() :: Tesla.Env.url()

Link to this section Functions

@spec add(path()) :: okmapped()

Add an IPFS object to the pinset.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-add

[
  recursive: <bool>, # Recursively pin the object linked to by the specified object(s). Default: true
  timeout: <string>, # Maximum time to wait for the command to complete. Default: 1m0s
]
@spec ls() :: okmapped()

List objects pinned to local storage.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-ls

[
  type: <string>, # The type of pinned keys to list. Can be "direct", "indirect", "recursive", "all". Default: "all"
  quiet: <bool>, # Write just hashes of objects. Default: false
  stream: <bool>, # Stream output of pins as they are found. Default: false
]
@spec ls(path()) :: okmapped()

List objects pinned to local storage.

parameters

Parameters

path - The path of the object to list pins for. Default: nil

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-ls

[
  type: <string>, # The type of pinned keys to list. Can be "direct", "indirect", "recursive", "all". Default: "all"
  quiet: <bool>, # Write just hashes of objects. Default: false
  stream: <bool>, # Stream output of pins as they are found. Default: false
]
Link to this function

remote_add(path, opts \\ [])

View Source
@spec remote_add(path(), opts()) :: okmapped()

Add a local object to the cluster pinset.

parameters

Parameters

path - The path of the object to list pins for.

options

Options

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-pin-remote-add

[
  name: <string>, # Optional name for the pin.
  background: <bool>, # Pin in the background. Default: false
  service: <string>, # The name of the remote pinning service to use.
]
@spec remote_ls(opts()) :: okmapped()

List objects pinned to remote storage.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-ls

[
  service: <string>, # The name of the remote pinning service to use.
  name: <string>, # The name of the remote pinset to list.
  cid: <array>, # Comma separated list of CIDs to list.
  status: <array>, # Comma separated list of statuses to filter by.
                    Default: "pinned"
                    Allowed: "queued", "pinning", "pinned", "failed"
]
@spec remote_rm(opts()) :: okmapped()

Remove pins from a remote pinset.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-remote-rm

[
  service: <string>, # The name of the remote pinning service to use.
  name: <string>, # The name of the remote pinset to remove pins from. Case sensitive and exact match.
  cid: <array>, # Comma separated list of CIDs to remove.
  status: <array>, # Comma separated list of statuses to filter by.
                    Default: "pinned"
                    Allowed: "queued", "pinning", "pinned", "failed"
  force: <bool>, # Force removal of pins that are not in the specified status. Default: false
]
Link to this function

remote_service_add(service, endpoint, key)

View Source
@spec remote_service_add(binary(), url(), binary()) :: okmapped()

Add a service endpoint to the cluster.

You should probably not use this, unless you are using the default API on localhost, since your AUTH token is shared.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-remote-service-add

[
  endpoint: <string>, # Endpoint to add to the cluster.
  name: <string>, # Name of the endpoint.
  key: <string>, # Key to use for the endpoint.
]
Link to this function

remote_service_ls(opts \\ [])

View Source
@spec remote_service_ls(opts()) :: okmapped()

List service endpoints in the cluster.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-remote-service-ls

[
  stat: <bool>, # Show extra information about the services. Default: false
]
Link to this function

remote_service_rm(service)

View Source
@spec remote_service_rm(name()) :: okmapped()

Remove a service endpoint from the cluster.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-remote-service-rm

[
  endpoint: <string>, # Endpoint to add to the cluster. Default: ""
  name: <string>, # Name of the endpoint. Default: ""
]
@spec rm(path()) :: okmapped()

Remove an IPFS object from the pinset.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-rm

[
  recursive: <bool>, # Recursively unpin the object linked to by the specified object(s). Default: true
]
Link to this function

update(old, new, opts \\ [])

View Source
@spec update(path(), path(), opts()) :: okmapped()

Update a recursive pin to a direct pin.

parameters

Parameters

old - The path of the old object. new - The path of the new object to pin.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-update

[
  unpin: <bool>, # Unpin the object when changing. Default: true
]
@spec verify(opts()) :: okmapped()

Verify that recursive pins are complete.

options

Options

https://docs.ipfs.io/reference/http/api/#api-v0-pin-verify

[
  verbose: <bool>, # Print extra information. Default: false
]