status-go/services/browsers
André Medeiros be683556ff
fix: close resultsets so we don't leak them (#1809)
* fix: close resultsets so we don't leak them

* Refactor browsers/database

To implement PR suggestions and improve code quality.

* Refactor services/permissions/database

To implement PR suggestions and improve code quality.

Co-authored-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
2020-05-14 11:51:32 +01:00
..
README.md Add browsers API (#1523) 2019-07-17 08:28:37 +03:00
api.go Create single database appdatase 2019-08-21 10:44:50 +03:00
api_test.go Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
database.go fix: close resultsets so we don't leak them (#1809) 2020-05-14 11:51:32 +01:00
service.go Create single database appdatase 2019-08-21 10:44:50 +03:00

README.md

Browsers Service

Browser service provides read/write API for browser object.

To enable include browsers config part and add browsers to APIModules:

{
  "BrowsersConfig": {
    "Enabled": true,
  },
  APIModules: "browsers"
}

API

Enabling service will expose three additional methods:

browsers_addBrowser

Stores browser in the database. All fields are specified below:

{
  "browser-id": "1",
  "name": "first",
  "timestamp": 10,
  "dapp?": true,
  "history-index": 1,
  "history": [
    "one",
    "two"
  ]
}

browsers_getBrowsers

Reads all browsers, returns in the format specified above. List is sorted by timestamp.

browsers_deleteBrowser

Delete browser from database. Accepts browser id.