The goog.storage.CollectableStorage Class

goog.storage.CollectableStorage
> goog.storage.ExpiringStorage
> goog.storage.RichStorage
> goog.storage.Storage

goog.storage.CollectableStorage(mechanism)

Provides a storage with expirning keys and a collection method.

mechanism {!goog.storage.mechanism.IterableMechanism}
The underlying storage mechanism.

.collect(opt_strict)

Cleans up the storage by removing expired keys.

opt_strict {boolean=}
Also remove invalid keys.

.get(key)

Inherited from goog.storage.RichStorage .

Get an item from the data storage.

key {string}
The key to get.
returns {*}
Deserialized value or undefined if not found.

.getWrapper(key, opt_expired)

Inherited from goog.storage.ExpiringStorage .

Get an item wrapper (the item and its metadata) from the storage.

key {string}
The key to get.
opt_expired {boolean=}
If true, return expired wrappers as well.
returns {(!Object|undefined)}
The wrapper, or undefined if not found.

.remove(key)

Inherited from goog.storage.Storage .

Remove an item from the data storage.

key {string}
The key to remove.

.set(key, value, opt_expiration)

Inherited from goog.storage.ExpiringStorage .

Set an item in the storage.

key {string}
The key to set.
value {*}
The value to serialize to a string and save.
opt_expiration {number=}
The number of miliseconds since epoch (as in goog.now()) when the value is to expire. If the expiration time is not provided, the value will persist as long as possible.