storage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage represents javascript Storage interface.

func Local

func Local() *Storage

Local returns local storage.

func Session

func Session() *Storage

Session returns session storage.

func (*Storage) Clear

func (s *Storage) Clear()

Clear clears all keys in storage.

func (*Storage) GetItem

func (s *Storage) GetItem(key string) (string, bool)

GetItem returns the key's value.

func (*Storage) Key

func (s *Storage) Key(idx int) string

Key returns nth key in the storage.

func (*Storage) Length

func (s *Storage) Length() int

Length returns an integer representing the number of data items stored in the Storage object.

func (*Storage) RemoveItem

func (s *Storage) RemoveItem(key string)

RemoveItem remove key from storage.

func (*Storage) SetItem

func (s *Storage) SetItem(key, val string)

SetItem set key/value into storage.

Jump to

Keyboard shortcuts

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