{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/comments/125266219","pull_request_review_id":47638857,"id":125266219,"diff_hunk":"@@ -137,7 +137,142 @@ This now has created the following structure, either on disk or as an in memory\n \n ## API\n \n-See https://ipfs.github.io/js-ipfs-repo\n+### Setup\n+\n+#### new Repo(path[, options])\n+\n+Creates an IPFS Repo.\n+\n+Arguments:\n+\n+* `path` (string, mandatory): the path for this repo\n+* `options` (object, optional): may contain the following values\n+  * `lock` (string, defaults to `\"fs\"` in Node.js, `\"memory\"` in the browser): what type of lock to use. Lock has to be acquired when opening.\n+  * `storageBackends` (object, optional): may contain the following values, which should each be a class implementing the [datastore interface](https://github.com/ipfs/interface-datastore#readme):\n+    * `root` (defaults to [`datastore-fs`](https://github.com/ipfs/js-datastore-fs#readme) in Node.js and [`datastore-level`](https://github.com/ipfs/js-datastore-level#readme) in the browser)\n+    * `blocks` (defaults to [`datastore-fs`](https://github.com/ipfs/js-datastore-fs#readme) in Node.js and [`datastore-level`](https://github.com/ipfs/js-datastore-level#readme) in the browser)\n+    * `datastore` (defaults to `datastore-level`)\n+\n+```js\n+const repo = new Repo('path/to/repo')\n+```\n+\n+#### repo.init (callback)\n+\n+Creates the necesary folder structure inside the repo.\n+\n+#### repo.open (callback)\n+\n+Locks the repo.\n+\n+#### repo.close (callback)\n+\n+Unlocks the repo.\n+\n+#### repo.exists (callback)\n+\n+Tells whether this repo exists or not. Callsback with `(err, bool)`.\n+\n+### Repos\n+\n+#### repo.put (key, value:Buffer, callback)\n+\n+Put a value at the root of the repo.\n+\n+* `key` can be a buffer, a string or a [Key](https://github.com/ipfs/interface-datastore#keys).\n+\n+#### repo.get (key, callback)\n+\n+Get a value at the root of the repo.\n+\n+* `key` can be a buffer, a string or a [Key](https://github.com/ipfs/interface-datastore#keys).\n+* `callback` is a callback function `function (err, result:Buffer)`\n+\n+#### repo.blocks.put (block:Block, callback)\n+\n+* `block` should be of type [Block](https://github.com/ipfs/js-ipfs-block#readme).\n+\n+#### repo.blocks.putMany (blocks, callback)\n+\n+Put many blocks block.\n+\n+* `block` should be an array of type [Block](https://github.com/ipfs/js-ipfs-block#readme).\n+\n+#### repo.blocks.get (cid, callback)\n+\n+Get block.\n+\n+* `cid` is the content id of [type CID](https://github.com/ipld/js-cid#readme).\n+* `callback` is a callback function `function (err, result:Buffer)`\n+\n+#### repo.datastore\n+\n+This is contains a full implementation of [the `interface-datastore` API](https://github.com/ipfs/interface-datastore#api).\n+\n+\n+### Convenience\n+\n+#### repo.config\n+\n+##### repo.config.set(key:string, value, callback)\n+\n+Set a config value. `value` can be any object that is serializable to JSON.\n+\n+* `key` is a string specifying the object path. Example:\n+\n+```js\n+repo.config.set('a.b.c', 'c value', (err) => {\n+  if (err) throw err\n+  repo.config.get((err, config) => {\n+    if (err) throw err\n+    assert.equal(config.a.b.c, 'c value')\n+  })\n+})\n+``\n+\n+\n+##### repo.config.set(value, callback)\n+\n+Set the whole config value. `value` can be any object that is serializable to JSON.\n+\n+##### repo.config.get(key:string, callback)\n+\n+Get a config value. `callback` is a function with the signature: `function (err, value)`, wehre the `\n+value` is of the same type that was set before.\n+\n+* `key` is a string specifying the object path. Example:\n+\n+```js\n+repo.config.set('a.b.c', (err, value) => {\n+  if (err) throw err\n+  console.log('config.a.b.c = ', value)\n+})\n+```\n+\n+##### repo.config.get(callback)\n+\n+Get the entire config value. `callback` is a function with the signature: `function (err, configValue:Object)`.\n+\n+#### repo.version\n+\n+##### repo.version.get (callback)\n+\n+Gets the repo version.\n+\n+##### repo.version.set (version:number, callback)\n+\n+Sets the repo version\n+\n+#### repo.apiAddr\n+\n+#### repo.apiAddr.get (callback)\n+\n+Gets the API address.\n+\n+#### repo.apiAddr.set (value:string, callback)","path":"README.md","position":null,"original_position":137,"commit_id":"25bab69a68d2f2bae06a17a048563ca708b52f5e","original_commit_id":"41b021e009ab7ffed33c03ca4e238e368fe656e5","user":{"login":"pgte","id":47910,"avatar_url":"https://avatars2.githubusercontent.com/u/47910?v=3","gravatar_id":"","url":"https://api.github.com/users/pgte","html_url":"https://github.com/pgte","followers_url":"https://api.github.com/users/pgte/followers","following_url":"https://api.github.com/users/pgte/following{/other_user}","gists_url":"https://api.github.com/users/pgte/gists{/gist_id}","starred_url":"https://api.github.com/users/pgte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgte/subscriptions","organizations_url":"https://api.github.com/users/pgte/orgs","repos_url":"https://api.github.com/users/pgte/repos","events_url":"https://api.github.com/users/pgte/events{/privacy}","received_events_url":"https://api.github.com/users/pgte/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-07-03T11:17:25Z","updated_at":"2017-07-03T11:17:25Z","html_url":"https://github.com/ipfs/js-ipfs-repo/pull/140#discussion_r125266219","pull_request_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140","_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/comments/125266219"},"html":{"href":"https://github.com/ipfs/js-ipfs-repo/pull/140#discussion_r125266219"},"pull_request":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140"}}},"pull_request":{"url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140","id":128096630,"html_url":"https://github.com/ipfs/js-ipfs-repo/pull/140","diff_url":"https://github.com/ipfs/js-ipfs-repo/pull/140.diff","patch_url":"https://github.com/ipfs/js-ipfs-repo/pull/140.patch","issue_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/140","number":140,"state":"open","locked":false,"title":"API revamp and cleansing","user":{"login":"pgte","id":47910,"avatar_url":"https://avatars2.githubusercontent.com/u/47910?v=3","gravatar_id":"","url":"https://api.github.com/users/pgte","html_url":"https://github.com/pgte","followers_url":"https://api.github.com/users/pgte/followers","following_url":"https://api.github.com/users/pgte/following{/other_user}","gists_url":"https://api.github.com/users/pgte/gists{/gist_id}","starred_url":"https://api.github.com/users/pgte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgte/subscriptions","organizations_url":"https://api.github.com/users/pgte/orgs","repos_url":"https://api.github.com/users/pgte/repos","events_url":"https://api.github.com/users/pgte/events{/privacy}","received_events_url":"https://api.github.com/users/pgte/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/ipfs/js-ipfs-repo/issues/139","created_at":"2017-06-29T08:38:31Z","updated_at":"2017-07-03T11:17:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2c553e9891569f36f0e2d65ca261a9aed2e839f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"kumavis","id":1474978,"avatar_url":"https://avatars3.githubusercontent.com/u/1474978?v=3","gravatar_id":"","url":"https://api.github.com/users/kumavis","html_url":"https://github.com/kumavis","followers_url":"https://api.github.com/users/kumavis/followers","following_url":"https://api.github.com/users/kumavis/following{/other_user}","gists_url":"https://api.github.com/users/kumavis/gists{/gist_id}","starred_url":"https://api.github.com/users/kumavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumavis/subscriptions","organizations_url":"https://api.github.com/users/kumavis/orgs","repos_url":"https://api.github.com/users/kumavis/repos","events_url":"https://api.github.com/users/kumavis/events{/privacy}","received_events_url":"https://api.github.com/users/kumavis/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140/commits","review_comments_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140/comments","review_comment_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/140/comments","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/statuses/25bab69a68d2f2bae06a17a048563ca708b52f5e","head":{"label":"ipfs:feat/api-cleansing","ref":"feat/api-cleansing","sha":"25bab69a68d2f2bae06a17a048563ca708b52f5e","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars3.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":46128002,"name":"js-ipfs-repo","full_name":"ipfs/js-ipfs-repo","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars3.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs-repo","description":"Implementation of the IPFS repo spec (https://github.com/ipfs/specs/tree/master/repo) in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs-repo","forks_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/deployments","created_at":"2015-11-13T14:55:11Z","updated_at":"2017-04-15T03:24:10Z","pushed_at":"2017-07-01T11:02:53Z","git_url":"git://github.com/ipfs/js-ipfs-repo.git","ssh_url":"git@github.com:ipfs/js-ipfs-repo.git","clone_url":"https://github.com/ipfs/js-ipfs-repo.git","svn_url":"https://github.com/ipfs/js-ipfs-repo","homepage":null,"size":326,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":7,"forks":17,"open_issues":7,"watchers":16,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"da45a57c99cf49cdb60e86217111418c0fad44d5","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars3.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":46128002,"name":"js-ipfs-repo","full_name":"ipfs/js-ipfs-repo","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars3.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs-repo","description":"Implementation of the IPFS repo spec (https://github.com/ipfs/specs/tree/master/repo) in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs-repo","forks_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/deployments","created_at":"2015-11-13T14:55:11Z","updated_at":"2017-04-15T03:24:10Z","pushed_at":"2017-07-01T11:02:53Z","git_url":"git://github.com/ipfs/js-ipfs-repo.git","ssh_url":"git@github.com:ipfs/js-ipfs-repo.git","clone_url":"https://github.com/ipfs/js-ipfs-repo.git","svn_url":"https://github.com/ipfs/js-ipfs-repo","homepage":null,"size":326,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":7,"forks":17,"open_issues":7,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140"},"html":{"href":"https://github.com/ipfs/js-ipfs-repo/pull/140"},"issue":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/140"},"comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/140/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/pulls/140/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/js-ipfs-repo/statuses/25bab69a68d2f2bae06a17a048563ca708b52f5e"}}}}
{"actor":{"display_login":"pgte"}}