Shaku

Shaku JS

Back To Table of Content

Storage Adapter

Classes

StorageAdapter

Storage adapter class that implement access to a storage device. Used by the Storage utilitiy.

StorageAdapterMemory

Implement simple memory storage adapter.

StorageAdapterLocalStorage

Implement simple localstorage storage adapter.

StorageAdapterSessionStorage

Implement simple sessionStorage storage adapter.

StorageAdapter

Storage adapter class that implement access to a storage device. Used by the Storage utilitiy.

Kind: global class

storageAdapter.persistent ⇒ Boolean

Return if this storage adapter is persistent storage or not.

Kind: instance property of StorageAdapter
Returns: Boolean - True if this storage type is persistent.

storageAdapter.isValid() ⇒ Boolean

Check if this adapter is OK to be used. For example, an adapter for localStorage will make sure it exists and not null.

Kind: instance method of StorageAdapter
Returns: Boolean - True if storage adapter is valid to be used.

storageAdapter.exists(key) ⇒ Boolean

Check if a key exists.

Kind: instance method of StorageAdapter
Returns: Boolean - True if key exists in storage.

Param Type Description
key String Key to check.

storageAdapter.setItem(key, value)

Set value.

Kind: instance method of StorageAdapter

Param Type Description
key String Key to set.
value String Value to set.

storageAdapter.getItem(key) ⇒ String

Get value.

Kind: instance method of StorageAdapter
Returns: String - Value or null if not set.

Param Type Description
key String Key to get.

storageAdapter.deleteItem(key)

Delete value.

Kind: instance method of StorageAdapter

Param Type Description
key String Key to delete.

storageAdapter.clear(prefix)

Clear all values from this storage device.

Kind: instance method of StorageAdapter

Param Type Description
prefix String Storage keys prefix.

StorageAdapterMemory

Implement simple memory storage adapter.

Kind: global class

new StorageAdapterMemory()

Create the memory storage adapter.

storageAdapterMemory.persistent

Kind: instance property of StorageAdapterMemory

storageAdapterMemory.isValid()

Kind: instance method of StorageAdapterMemory

storageAdapterMemory.exists()

Kind: instance method of StorageAdapterMemory

storageAdapterMemory.setItem()

Kind: instance method of StorageAdapterMemory

storageAdapterMemory.getItem()

Kind: instance method of StorageAdapterMemory

storageAdapterMemory.deleteItem()

Kind: instance method of StorageAdapterMemory

storageAdapterMemory.clear()

Kind: instance method of StorageAdapterMemory

StorageAdapterLocalStorage

Implement simple localstorage storage adapter.

Kind: global class

storageAdapterLocalStorage.persistent

Kind: instance property of StorageAdapterLocalStorage

storageAdapterLocalStorage.isValid()

Kind: instance method of StorageAdapterLocalStorage

storageAdapterLocalStorage.exists()

Kind: instance method of StorageAdapterLocalStorage

storageAdapterLocalStorage.setItem()

Kind: instance method of StorageAdapterLocalStorage

storageAdapterLocalStorage.getItem()

Kind: instance method of StorageAdapterLocalStorage

storageAdapterLocalStorage.deleteItem()

Kind: instance method of StorageAdapterLocalStorage

storageAdapterLocalStorage.clear()

Kind: instance method of StorageAdapterLocalStorage

StorageAdapterSessionStorage

Implement simple sessionStorage storage adapter.

Kind: global class

storageAdapterSessionStorage.persistent

Kind: instance property of StorageAdapterSessionStorage

storageAdapterSessionStorage.isValid()

Kind: instance method of StorageAdapterSessionStorage

storageAdapterSessionStorage.exists()

Kind: instance method of StorageAdapterSessionStorage

storageAdapterSessionStorage.setItem()

Kind: instance method of StorageAdapterSessionStorage

storageAdapterSessionStorage.getItem()

Kind: instance method of StorageAdapterSessionStorage

storageAdapterSessionStorage.deleteItem()

Kind: instance method of StorageAdapterSessionStorage

storageAdapterSessionStorage.clear()

Kind: instance method of StorageAdapterSessionStorage