0.0.5 • Published 7 years ago

@smartcloud/memcached v0.0.5

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
7 years ago

@smartcloud/memcached

Memcached Module of SmartCloud Utility Library for Node.js

npm installation

$ npm install --save @smartcloud/memcached

Initialization

The module has core class named "Memcached". To initialize an Memcached object, pass the follow parameters.

* host - (required) specify relevant memcached host. 

* port - (required) specify relevant memcached port. 

* entityKind - (optional) specify entityKind which is also used as target EntityKind in Google cloud datastore. If not defined, "Memcached" will be target entity kind.

* maxRetries - (optional) specify maximum number of times that process can retry in case of failure.  If not specified, default will be 10.

Sample usage

const SmartCloudMemcached = require('@smartcloud/memcached');

var client = new SmartCloudMemcached.Memcached({
    host: 'host',
    port: 1234
});

Methods

  • memcached() method - Return current memcached instance associated with current Memcached instance

  • get(key) method - Return related value (if any) for specified key.

  • set(key, value) method - Store key-value pair.

  • delete(key) method - Delete key-value pair (if any) for specified key.