Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xadillax/toshihiko-aliyun-ocs
Aliyun OCS (Memcached) cache layout for Toshihiko.
https://github.com/xadillax/toshihiko-aliyun-ocs
Last synced: 29 days ago
JSON representation
Aliyun OCS (Memcached) cache layout for Toshihiko.
- Host: GitHub
- URL: https://github.com/xadillax/toshihiko-aliyun-ocs
- Owner: XadillaX
- License: mit
- Created: 2016-01-04T06:51:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-03T02:53:39.000Z (4 months ago)
- Last Synced: 2024-10-09T13:57:30.611Z (about 1 month ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Toshihiko Aliyun OCS (Cache Layout)
[![travis.ci](https://img.shields.io/travis/XadillaX/toshihiko-aliyun-ocs.svg)](https://travis-ci.org/XadillaX/toshihiko-aliyun-ocs)
[![coveralls](https://img.shields.io/coveralls/XadillaX/toshihiko-aliyun-ocs.svg)](https://coveralls.io/r/XadillaX/toshihiko-aliyun-ocs)
[![License](https://img.shields.io/npm/l/toshihiko-aliyun-ocs.svg?style=flat)](https://www.npmjs.org/package/toshihiko-aliyun-ocs)
[![Dependency Status](https://david-dm.org/XadillaX/toshihiko-aliyun-ocs.svg)](https://david-dm.org/XadillaX/toshihiko-aliyun-ocs)
[![Toshihiko-Memcached](http://img.shields.io/npm/v/toshihiko-aliyun-ocs.svg)](https://www.npmjs.org/package/toshihiko-aliyun-ocs)
[![Toshihiko-Memcached](http://img.shields.io/npm/dm/toshihiko-aliyun-ocs.svg)](https://www.npmjs.org/package/toshihiko-aliyun-ocs)The Aliyun OCS support for Toshihiko as an addon.
## Installation
```sh
$ npm install toshihiko-aliyun-ocs --save
```## How to Use
When you define a Toshihiko, you could pass the object into `cache` option:
```javascript
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 be `aliyun-ocs` and then Toshihiko will search for the package `toshihiko-aliyun-ocs`.
>
> You can give a `prefix` in `options`.Otherwise, you may create this object by yourself and pass the created object into cached:
```javascript
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
```javascript
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!
「雖然我覺得不怎麼可能有人會關注我」