go-indexeddb
This expirement will attempt to implement IndexedDB features for Go. It wraps goleveldb similar to how Chrome's implementation utilizes LevelDB under the hood.
Structure
Key | Value |
---|---|
["core"] |
database definition |
["core", "store", <store>] |
store spec |
["core", "index", <index>] |
index spec |
["data", <store>, <id>] |
data record |
["idx", <index>, <key>] |
index record (unique) |
["idx", <index>, <key>, <id>] |
index record |
<store>
(string) Name of the Store<index>
(string) Name of the Index<id>
(string, float, bool, nil, slice) unique identifier for a document<key>
(string, float, bool, nil, slice) index key
Roadmap
Implement the API as described by MDN and defined by W3C.
cloneable
As per the spec, objects to be stored should be supported by the structured clone algorithm. Currently using Go's json marshalling.
synchronicity
One obvious differentiator between Go and Javascript would be the need to make the library asynchronous. In Go it is pretty easy to make sync libraries work async, so should be up to the user. However if there is enough demand async wrappers could be added.
storage limits
Browser storage limits and eviction criteria are beyond the scope of this project. At least initially.