Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
feat(pinning): add pin.ls + rm spec
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Aug 9, 2016
1 parent b1db43c commit 155041f
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions API/pinning-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,49 @@ Example:
ipfs.pin.add(hash, function (err) {})
```


#### `ls`

>
> List all the objects pinned to local storage or under a specific hash.
##### `Go` **WIP**

##### `JavaScript` - ipfs.SOMETHING(data, [callback])
##### `JavaScript` - ipfs.pin.ls([hash, options, callback])

`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of:
Where:

- `hash` is an IPFS multihash.
- `options` is an object that can contain the following keys:
- `type` - Return also the type of pin (direct, indirect or recursive)

`callback` must follow `function (err, pinset) {}` signature, where `err` is an error if the operation was not successful. `pinset` is an array of objects with keys `hash` and `type`.

If no `callback` is passed, a promise is returned.

Example:

```JavaScript
ipfs.pin.ls(function (err, pinset) {})
```


#### `rm`

>
> Remove an hash from the pinset
##### `Go` **WIP**

##### `JavaScript` - ipfs.SOMETHING(data, [callback])
##### `JavaScript` - ipfs.pin.rm(hash, [callback])

Where `hash` is a multihash.

`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of:
`callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful.

If no `callback` is passed, a promise is returned.

Example:

```JavaScript
ipfs.pin.rm(hash, function (err, pinset) {})
```


0 comments on commit 155041f

Please sign in to comment.