toshihiko-aliyun-ocs
v1.0.0
Published
Aliyun OCS (Memcached) cache layout for Toshihiko.
Downloads
8
Readme
Toshihiko Aliyun OCS (Cache Layout)
The Aliyun OCS support for Toshihiko as an addon.
Installation
$ npm install toshihiko-aliyun-ocs --save
How to Use
When you define a Toshihiko, you could pass the object into cache
option:
var T = require("toshihiko");
var toshihiko = new T.Toshihiko("database", "username", "", {
cache: {
name: "aliyun-ocs",
host: "ALIYUN_OCS_HOST",
port: 11211,
username: "ALIYUN_OCS_USERNAME",
password: "ALIYUN_OCS_PASSWORD",
options: { prefix: "_" }
}
});
name
must bealiyun-ocs
and then Toshihiko will search for the packagetoshihiko-aliyun-ocs
.You can give a
prefix
inoptions
.
Otherwise, you may create this object by yourself and pass the created object into cached:
var OCS = require("toshihiko-aliyun-ocs");
var object = Memcached.create(HOST, PORT, USERNAME, PASSWORD, OPTIONS);
var toshihiko = new T.Toshihiko(DATABASE, USERNAME, PASSWORD, {
cache: object
});
or
var Memcached = require("toshihiko-aliyun-ocs");
var object = new Memcached(HOST, PORT, USERNAME, PASSWORD, OPTIONS);
var toshihiko = new T.Toshihiko(DATABASE, USERNAME, PASSWORD, {
cache: object
});
And then you may enjoy the cache layer of Toshihiko!
Contribution
You're welcome to make pull requests or issues!
「雖然我覺得不怎麼可能有人會關注我」