storage

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package storage はWebGoへLocal StorageとSession Storageを公開する。

Index

Constants

This section is empty.

Variables

View Source
var ErrUnavailable = errors.New("storage is unavailable")

Functions

This section is empty.

Types

type API

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

API はPageのLocal / Session Storageを明示的に分離する。

func New

func New(local, session *storagecore.Area) *API

New はPageに対応するWeb Storage APIを生成する。

func NewPage added in v0.10.0

func NewPage(local, session *storagecore.Area, source storagecore.MutationSource, enqueue func(func()) bool) *API

NewPage creates a page-scoped API and subscribes it to Local Storage events.

func (*API) Close added in v0.10.0

func (api *API) Close()

Close stops Local Storage event delivery to this page.

func (*API) Local

func (api *API) Local() *Storage

func (*API) OnChange added in v0.10.0

func (api *API) OnChange(listener func(Event)) bool

OnChange registers a listener for committed changes from another page.

func (*API) Session

func (api *API) Session() *Storage

type Event added in v0.10.0

type Event = storagecore.Change

Event is delivered when another same-origin page commits Local Storage.

type Storage

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

Storage はWebGoから操作する1つのStorage Areaである。

func (*Storage) Clear

func (storage *Storage) Clear() error

func (*Storage) Get

func (storage *Storage) Get(key string) (string, bool, error)

func (*Storage) Key

func (storage *Storage) Key(index int) (string, bool)

func (*Storage) Length

func (storage *Storage) Length() int

func (*Storage) Remove

func (storage *Storage) Remove(key string) error

func (*Storage) Set

func (storage *Storage) Set(key, value string) error

Jump to

Keyboard shortcuts

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