Documentation ¶
Index ¶
- Constants
- func Delete(db *idb.Database, objectStoreName string, key js.Value) error
- func DeleteIndex(db *idb.Database, objectStoreName, indexName, pkeyName string, key js.Value) error
- func Dump(db *idb.Database, objectStoreName string) ([]string, error)
- func EncodeBytes(input []byte) js.Value
- func Get(db *idb.Database, objectStoreName string, key js.Value) (js.Value, error)
- func GetAll(db *idb.Database, objectStoreName string) ([]js.Value, error)
- func GetIndex(db *idb.Database, objectStoreName, indexName string, key js.Value) (js.Value, error)
- func NewContext() (context.Context, context.CancelFunc)
- func Put(db *idb.Database, objectStoreName string, value js.Value) (js.Value, error)
Constants ¶
const ( // ErrDoesNotExist is an error string for got undefined on Get operations. ErrDoesNotExist = "result is undefined" // ErrUniqueConstraint is an error string for failed uniqueness inserts. ErrUniqueConstraint = "at least one key does not satisfy the uniqueness requirements" )
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Delete is a generic helper for removing values from the given idb.ObjectStore. Only usable by primary key.
func DeleteIndex ¶
DeleteIndex is a generic helper for removing values from the given idb.ObjectStore using the given idb.Index. Requires passing in the name of the primary key for the store.
func Dump ¶
Dump returns the given idb.ObjectStore contents to string slice for testing and debugging purposes.
func EncodeBytes ¶
EncodeBytes returns the proper IndexedDb encoding for a byte slice into js.Value.
func Get ¶
Get is a generic helper for getting values from the given idb.ObjectStore. Only usable by primary key.
func GetAll ¶
GetAll is a generic helper for getting all values from the given idb.ObjectStore.
func GetIndex ¶
GetIndex is a generic helper for getting values from the given idb.ObjectStore using the given idb.Index.
func NewContext ¶
func NewContext() (context.Context, context.CancelFunc)
NewContext builds a context for indexedDb operations.
Types ¶
This section is empty.