Help us shape the future of Go! Take the 2026 Go Developer Survey

browser_storage

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

View Source
const StorageModeEnv = "BLDR_BROWSER_STORAGE"

StorageModeEnv selects the browser storage backend after the browser probes its actual capabilities.

Variables

This section is empty.

Functions

func BuildStorage

func BuildStorage(_ bus.Bus, prefix string) []storage.Storage

BuildStorage builds all available storage methods.

prefix is used as the IndexedDB prefix in the browser.

func NewIndexedDB

func NewIndexedDB(prefix string, verbose bool) storage.Storage

NewIndexedDB constructs an IndexedDB storage handle.

Types

type IndexedDB

type IndexedDB struct {
	// contains filtered or unexported fields
}

IndexedDB implements the indexeddb-backed storage.

func (*IndexedDB) AddFactories

func (i *IndexedDB) AddFactories(b bus.Bus, sr *static.Resolver)

AddFactories adds the factories to the resolver.

func (*IndexedDB) BuildVolumeConfig

func (i *IndexedDB) BuildVolumeConfig(id string, baseVolCtrlConf *volume_controller.Config) (config.Config, error)

BuildVolumeConfig creates the volume config for the store ID. Returns nil if the storage cannot produce Volume.

func (*IndexedDB) DeleteVolume

func (i *IndexedDB) DeleteVolume(id string) error

DeleteVolume removes the IndexedDB database for the given volume ID.

func (*IndexedDB) GetStorageInfo

func (i *IndexedDB) GetStorageInfo() *storage.StorageInfo

GetStorageInfo returns StorageInfo.

type OpfsStorage

type OpfsStorage struct {
	// contains filtered or unexported fields
}

OpfsStorage implements OPFS-backed browser storage.

func NewOpfsStorage

func NewOpfsStorage(prefix string) *OpfsStorage

NewOpfsStorage constructs an OPFS storage handle.

func (*OpfsStorage) AddFactories

func (s *OpfsStorage) AddFactories(b bus.Bus, sr *static.Resolver)

AddFactories adds the factories to the resolver.

func (*OpfsStorage) BuildVolumeConfig

func (s *OpfsStorage) BuildVolumeConfig(id string, baseVolCtrlConf *volume_controller.Config) (config.Config, error)

BuildVolumeConfig creates the volume config for the store ID.

func (*OpfsStorage) DeleteVolume

func (s *OpfsStorage) DeleteVolume(id string) error

DeleteVolume removes the active OPFS volume while retaining replaced legacy data.

func (*OpfsStorage) GetStorageInfo

func (s *OpfsStorage) GetStorageInfo() *storage.StorageInfo

GetStorageInfo returns StorageInfo.

Jump to

Keyboard shortcuts

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