indexed_db

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

View Source
const (
	// The cursor shows all records, including duplicates.
	// It starts at the lower bound of the key range and moves
	// upwards (monotonically increasing in the order of keys).
	CursorDirectionNext = "next"
	// The cursor shows all records, excluding duplicates.
	// If multiple records exist with the same key, only the
	// first one iterated is retrieved. It starts at the lower
	// bound of the key range and moves upwards.
	CursorDirectionNextUnique = "nextunique"
	// The cursor shows all records, including duplicates.
	// It starts at the upper bound of the key range and moves
	// downwards (monotonically decreasing in the order of keys).
	CursorDirectionPrev = "prev"
	// The cursor shows all records, excluding duplicates.
	// If multiple records exist with the same key, only the
	// first one iterated is retrieved. It starts at the upper
	// bound of the key range and moves downwards.
	CursorDirectionPrevUnique = "prevunique"
)
View Source
const (
	// The blocked handler is executed when an open
	// connection to a database is blocking a
	// versionchange transaction on the same database.
	BlockedEvent = "blocked"
	// The upgradeneeded event is fired when an attempt
	// was made to open a database with a version number
	// higher than its current version.
	UpgradeNeededEvent = "upgradeneeded"
)
View Source
const (
	// The error handler is executed when an error
	// caused a request to fail.
	ErrorEvent = "error"
	// The success event is fired when an IDBRequest succeeds.
	SuccessEvent = "success"
)
View Source
const (
	TransactionModeReadOnly       = "readonly"
	TransactionModeReadWrite      = "readwrite"
	TransactionModeReadWriteFlush = "readwriteflush"
	TransactionDurabilityDefault  = "default"
	TransactionDurabilityStrict   = "strict"
	TransactionDurabilityRelaxed  = "relaxed"
)

Variables

View Source
var KeyRange keyRange

KeyRange wraps the IDBKeyRange global interface.

https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange

Functions

func Await

func Await(request RequestValue) (res js.Value, err error)

Await is a helper that waits for a request and returns the result and error.

func Cmp

func Cmp(first, second js.Value) int

Cmp wraps the IDBFactory cmp method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/cmp

func Databases

func Databases() goji.PromiseValue

Databases wraps the IDBFactory databases method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/databases

Types

type CursorValue

type CursorValue js.Value

CursorValue is an instance of IDBCursor.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor

func (CursorValue) Advance

func (c CursorValue) Advance(count uint)

Advance wraps the IDBCursor advance instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/advance

func (CursorValue) Continue

func (c CursorValue) Continue(key js.Value)

Continue wraps the IDBCursor continue instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/continue

func (CursorValue) ContinuePrimaryKey

func (c CursorValue) ContinuePrimaryKey(key, primaryKey js.Value)

ContinuePrimaryKey wraps the IDBCursor continuePrimaryKey instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/continuePrimaryKey

func (CursorValue) Delete

func (c CursorValue) Delete() RequestValue

Delete wraps the IDBCursor delete instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/delete

func (CursorValue) Direction

func (c CursorValue) Direction() string

Direction returns the IDBCursor direction property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/direction

func (CursorValue) Key

func (c CursorValue) Key() js.Value

Key returns the IDBCursor key property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/key

func (CursorValue) PrimaryKey

func (c CursorValue) PrimaryKey() js.Value

PrimaryKey returns the IDBCursor primaryKey property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/primaryKey

func (CursorValue) Request

func (c CursorValue) Request() RequestValue

Request returns the IDBCursor request property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/request

func (CursorValue) Source

func (c CursorValue) Source() js.Value

Source returns the IDBCursor request property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/source

func (CursorValue) Update

func (c CursorValue) Update(value js.Value) RequestValue

Update wraps the IDBCursor update instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/update

type CursorWithValue

type CursorWithValue struct {
	CursorValue
}

CursorWithValue is an instance of IDBCursorWithValue

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursorWithValue

func (CursorWithValue) Value

func (c CursorWithValue) Value() js.Value

Value returns the IDBCursorWithValue value property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBCursorWithValue/value

type DatabaseValue

type DatabaseValue struct {
	goji.EventTargetValue
}

DatabaseValue is an instance of IDBDatabase

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase

func (DatabaseValue) Close

func (d DatabaseValue) Close()

Close wraps the IDBDatabase close instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/close

func (DatabaseValue) CreateObjectStore

func (d DatabaseValue) CreateObjectStore(name string, options js.Value) ObjectStoreValue

CreateObjectStore wraps the IDBDatabase createObjectStore instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore

func (DatabaseValue) DeleteObjectStore

func (d DatabaseValue) DeleteObjectStore(name string)

DeleteObjectStore wraps the IDBDatabase deleteObjectStore instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/deleteObjectStore

func (DatabaseValue) Name

func (d DatabaseValue) Name() string

Name returns the IDBDatabase name property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/name

func (DatabaseValue) ObjectStoreNames

func (d DatabaseValue) ObjectStoreNames() js.Value

ObjectStoreNames returns the IDBDatabase objectStoreNames property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/objectStoreNames

func (DatabaseValue) Transaction

func (d DatabaseValue) Transaction(storeNames js.Value, mode string, options js.Value) TransactionValue

Transaction wraps the IDBDatabase transaction instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction

func (DatabaseValue) Version

func (d DatabaseValue) Version() int

Version returns the IDBDatabase version property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/version

type IndexValue

type IndexValue js.Value

IndexValue is an IDBIndex instance.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex

func (IndexValue) Count

func (i IndexValue) Count(key js.Value) RequestValue

Count wraps the IDBIndex count instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/count

func (IndexValue) Get

func (i IndexValue) Get(key js.Value) RequestValue

Get wraps the IDBIndex get instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/get

func (IndexValue) GetAll

func (i IndexValue) GetAll(query, count js.Value) RequestValue

GetAll wraps the IDBIndex getAll instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/getAll

func (IndexValue) GetAllKeys

func (i IndexValue) GetAllKeys(query, count js.Value) RequestValue

GetAllKeys wraps the IDBIndex getAllKeys instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/getAllKeys

func (IndexValue) GetKey

func (i IndexValue) GetKey(key js.Value) RequestValue

GetKey wraps the IDBIndex getKey instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/getKey

func (IndexValue) KeyPath

func (i IndexValue) KeyPath() js.Value

KeyPath returns the IDBIndex keyPath property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/keyPath

func (IndexValue) MultiEntry

func (i IndexValue) MultiEntry() bool

MultiEntry returns the IDBIndex multiEntry property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/multiEntry

func (IndexValue) Name

func (i IndexValue) Name() string

Name returns the IDBIndex name property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/name

func (IndexValue) ObjectStore

func (i IndexValue) ObjectStore() ObjectStoreValue

ObjectStore returns the IDBIndex objectStore property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/objectStore

func (IndexValue) OpenCursor

func (i IndexValue) OpenCursor(key, direction js.Value) RequestValue

OpenCursor wraps the IDBIndex openCursor instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/openCursor

func (IndexValue) OpenKeyCursor

func (i IndexValue) OpenKeyCursor(key, direction js.Value) RequestValue

OpenKeyCursor wraps the IDBIndex openKeyCursor instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/openKeyCursor

func (IndexValue) Unique

func (i IndexValue) Unique() bool

Unique returns the IDBIndex unique property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/unique

type KeyRangeValue

type KeyRangeValue js.Value

KeyRangeValue is an instance of IDBKeyRange.

func (KeyRangeValue) Includes

func (k KeyRangeValue) Includes(key js.Value) bool

Includes wraps the IDBKeyRange includes instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/includes

func (KeyRangeValue) Lower

func (k KeyRangeValue) Lower() js.Value

Lower returns the IDBKeyRange lower property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/lower

func (KeyRangeValue) LowerOpen

func (k KeyRangeValue) LowerOpen() bool

LowerOpen returns the IDBKeyrange lowerOpen property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/lowerOpen

func (KeyRangeValue) Upper

func (k KeyRangeValue) Upper() js.Value

Upper returns the IDBKeyRange upper property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/upper

func (KeyRangeValue) UpperOpen

func (k KeyRangeValue) UpperOpen() bool

UpperOpen returns the IDBKeyRange upperOpen property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/upperOpen

type ObjectStoreValue

type ObjectStoreValue js.Value

ObjectStoreValue is an instance of IDBObjectStore.

func (ObjectStoreValue) Add

func (o ObjectStoreValue) Add(value js.Value, key js.Value) RequestValue

Add wraps the IDBObjectStore add instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/add

func (ObjectStoreValue) AutoIncrement

func (o ObjectStoreValue) AutoIncrement() bool

AutoIncrement returns the IDBObjectStore autoIncrement property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/autoIncrement

func (ObjectStoreValue) Clear

func (o ObjectStoreValue) Clear() RequestValue

Clear wraps the IDBObjectStore clear instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/clear

func (ObjectStoreValue) Count

func (o ObjectStoreValue) Count(query js.Value) RequestValue

Count wraps the IDBObjectStore count instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/count

func (ObjectStoreValue) CreateIndex

func (o ObjectStoreValue) CreateIndex(indexName, keyPath, options js.Value) IndexValue

CreateIndex wraps the IDBObjectStore createIndex instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex

func (ObjectStoreValue) Delete

func (o ObjectStoreValue) Delete(key js.Value) RequestValue

Delete wraps the IDBObjectStore delete instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/delete

func (ObjectStoreValue) DeleteIndex

func (o ObjectStoreValue) DeleteIndex(key js.Value)

DeleteIndex wraps the IDBObjectStore deleteIndex instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/deleteIndex

func (ObjectStoreValue) Get

Get wraps the IDBObjectStore get instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/get

func (ObjectStoreValue) GetAll

func (o ObjectStoreValue) GetAll(key js.Value, count js.Value) RequestValue

GetAll wraps the IDBObjectStore getAll instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll

func (ObjectStoreValue) GetAllKeys

func (o ObjectStoreValue) GetAllKeys(key js.Value, count js.Value) RequestValue

GetAllKeys wraps the IDBObjectStore getAllKeys instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAllKeys

func (ObjectStoreValue) GetKey

func (o ObjectStoreValue) GetKey(key js.Value) RequestValue

GetKey wraps the IDBObjectStore getKey instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getKey

func (ObjectStoreValue) Index

func (o ObjectStoreValue) Index(name string) IndexValue

Index wraps the IDBObjectStore index instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/index

func (ObjectStoreValue) IndexNames

func (o ObjectStoreValue) IndexNames() js.Value

IndexNames returns the IDBObjectStore indexNames property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/indexNames

func (ObjectStoreValue) KeyPath

func (o ObjectStoreValue) KeyPath() js.Value

KeyPath returns the IDBObjectStore keyPath property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/keyPath

func (ObjectStoreValue) Name

func (o ObjectStoreValue) Name() string

Name returns the IDBObjectStore name property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/name

func (ObjectStoreValue) OpenCursor

func (o ObjectStoreValue) OpenCursor(query, direction js.Value) RequestValue

OpenCursor wraps the IDBObjectStore openCursor instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/openCursor

func (ObjectStoreValue) OpenKeyCursor

func (o ObjectStoreValue) OpenKeyCursor(query, direction js.Value) RequestValue

OpenKeyCursor wraps the IDBObjectStore openKeyCursor instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/openKeyCursor

func (ObjectStoreValue) Put

func (o ObjectStoreValue) Put(item, key js.Value) RequestValue

Put wraps the IDBObjectStore put instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/put

func (ObjectStoreValue) Transaction

func (o ObjectStoreValue) Transaction() TransactionValue

Transaction returns the IDBObjectStore transaction property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/transaction

type RequestValue

type RequestValue struct {
	goji.EventTargetValue
}

RequestValue is an instance of IDBRequest.

func DeleteDatabase

func DeleteDatabase(name string, options js.Value) RequestValue

DeleteDatabase wraps the IDBFactory deleteDatabase method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/deleteDatabase

func Open

func Open(name string, version uint) RequestValue

Open wraps the IDBFactory open method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open

func (RequestValue) Error

func (r RequestValue) Error() js.Value

Error returns the IDBRequest error property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/error

func (RequestValue) ReadyState

func (r RequestValue) ReadyState() string

ReadyState returns the IDBRequest readyState property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/readyState

func (RequestValue) Result

func (r RequestValue) Result() js.Value

Result returns the IDBRequest result property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/result

func (RequestValue) Source

func (r RequestValue) Source() js.Value

Source returns the IDBRequest source property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/source

func (RequestValue) Transaction

func (r RequestValue) Transaction() TransactionValue

Transaction returns the IDBRequest transaction property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/transaction

type TransactionValue

type TransactionValue goji.EventTargetValue

TransactionValue is an instance of IDBTransaction.

func (TransactionValue) Abort

func (t TransactionValue) Abort()

Abort wraps the IDBTransaction abort instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/abort

func (TransactionValue) Commit

func (t TransactionValue) Commit()

Commit wraps the IDBTransaction commit instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/commit

func (TransactionValue) DB

DB returns the IDBTransaction db property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/db

func (TransactionValue) Durability

func (t TransactionValue) Durability() string

Durability returns the IDBTransaction durability property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/durability

func (TransactionValue) Error

func (t TransactionValue) Error() js.Value

Error returns the IDBTransaction error property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/error

func (TransactionValue) Mode

func (t TransactionValue) Mode() string

String returns the IDBTransaction mode property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/mode

func (TransactionValue) ObjectStore

func (t TransactionValue) ObjectStore(name string) ObjectStoreValue

ObjectStore wraps the IDBTransaction objectStore instance method.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/objectStore

func (TransactionValue) ObjectStoreNames

func (t TransactionValue) ObjectStoreNames() js.Value

ObjectStoreNames returns the IDBTransaction objectStoreNames property.

https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/ObjectStoreNames

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL