Leverege Platform

Leverege Platform

  • Overview
  • JSDocs
  • REST API
  • Help

›JSDoc

JSDoc

  • Home
  • API Server
  • API Attributes
  • Api Patch Ops
  • API Redux
  • Array Util
  • Base62 Util
  • Cache
  • Cluster Manager
  • Data Store
  • Exit
  • Factory
  • Limit
  • Lock
  • Message Queue
  • Messages
  • Path
  • Permissions
  • Reasoner
  • String Util
  • UI Active Theme
  • UI Elements
  • UI Linear View Elements
  • UI Mapbox Elements
  • Validator

Cache

Classes

Cache
InMemoryCache

creates an in memory cache and an interface to interact with it

RedisCache

maintains a connection with redis and communicates with redis

Functions

NO_VALUE Returns a string that is usable as an indication that a value was stored into the cache that represents a null value()
use getNs(key) ⇒ Promise
use multiGetNs(keys) ⇒ Promise
especially those that can cause unit tests to hang until everything shuts down cleanly.()
create Creates a cache of a specifed type(options)
get gets the value at the key(key)
multiGet gets and returns that values from multiple keys(keys)
set sets a value into the cache(key, value, opts)
remove removes a value from the cache(key)
clear clears the inmemory cache()
get gets and returns a value from the cache(key)
multiGet gets and returns that values from multiple keys(keys)
set sets a value into the redis cache(key, value, opts)
remove removes a value from the redis cache(key, opts)
end ends the connection to the redis database()

Cache

Kind: global class

new Cache()

Creates a Cache object

ParamTypeDescription
options.namespacestringthe namespace string to use in the xxxNs methods. Defaults to 'app'

InMemoryCache

creates an in memory cache and an interface to interact with it

Kind: global class

new InMemoryCache(options)

ParamType
optionsobject

RedisCache

maintains a connection with redis and communicates with redis

Kind: global class

new RedisCache(options)

ParamTypeDescription
optionsobject
options.connectionobjectconfig for the redis connection

NO_VALUE Returns a string that is usable as an indication that a value was stored into the cache that represents a null value()

Kind: global function

create Creates a cache of a specifed type(options)

Kind: global function

ParamTypeDescription
optionsobjectthe cache options
options.typestringthe type of cache to make. If unrecognized, this will return a no-op cache. Possible values: 'redis', 'inMemory', none'
options.prefixstringa string that will prepended (with a ':') to all keys when accessing the cache. The resulting key will be prefix:key
options.cacheConfigobjectThis can be an object, JSON or reference to a json/js file. If defined, it will be expanded and merged with the other options like prefix. This allows the cache type to be controlled by an environment variable or file.

get gets the value at the key(key)

Kind: global function

ParamTypeDescription
keystringthe value to get

multiGet gets and returns that values from multiple keys(keys)

Kind: global function

ParamTypeDescription
keysarraythe keys to get the values for

set sets a value into the cache(key, value, opts)

Kind: global function

ParamTypeDescription
keystringthe key to set the value at
valueanythe value to be set
optsobjct

remove removes a value from the cache(key)

Kind: global function

ParamTypeDescription
keystringthe key to remove the value at

clear clears the inmemory cache()

Kind: global function

get gets and returns a value from the cache(key)

Kind: global function

ParamTypeDescription
keystringvalue to get from the cache

multiGet gets and returns that values from multiple keys(keys)

Kind: global function

ParamTypeDescription
keysarraythe keys to get the values for

set sets a value into the redis cache(key, value, opts)

Kind: global function

ParamTypeDescription
keystringthe key to set the value at
valueanythe value to be set
optsobjct

remove removes a value from the redis cache(key, opts)

Kind: global function

ParamTypeDescription
keystringthe key to remove the value at
opts*

end ends the connection to the redis database()

Kind: global function

← Base62 UtilCluster Manager →
  • Classes
  • Functions
  • Cache
    • new Cache()
  • InMemoryCache
    • new InMemoryCache(options)
  • RedisCache
    • new RedisCache(options)
  • NO_VALUE Returns a string that is usable as an indication that a value was stored into the cache that represents a null value()
  • create Creates a cache of a specifed type(options)
  • get gets the value at the key(key)
  • multiGet gets and returns that values from multiple keys(keys)
  • set sets a value into the cache(key, value, opts)
  • remove removes a value from the cache(key)
  • clear clears the inmemory cache()
  • get gets and returns a value from the cache(key)
  • multiGet gets and returns that values from multiple keys(keys)
  • set sets a value into the redis cache(key, value, opts)
  • remove removes a value from the redis cache(key, opts)
  • end ends the connection to the redis database()
Leverege Platform
Docs
Overview
Connect
FacebookLinkedInTwitter
Facebook Open Source