Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b68a37a1
authored
2013-06-20 13:58:35 +0200
by
Dobrosław Żybort
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Some updates to cache README
1 parent
b886ed59
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
17 deletions
cache/README.md
cache/README.md
View file @
b68a37a
## cache
cache is a
golang cache manager. It can use cache for many
adapters. The repo is inspired by
`database/sql`
.
cache is a
Go cache manager. It can use many cache
adapters. The repo is inspired by
`database/sql`
.
##How to install
## How to install?
go get github.com/astaxie/beego/cache
##how many adapter support
## What adapters are supported?
As of now this cache support memory, Memcache and Redis.
Now this cache support memory/redis/memcache
## how to use it
first you must import it
## How to use it?
First you must import it
import (
"github.com/astaxie/beego/cache"
)
then init an Cache(
memory adapter)
Then init a Cache (example with
memory adapter)
bm, err := NewCache("memory", `{"interval":60}`)
u
se it like this:
U
se it like this:
bm.Put("astaxie", 1, 10)
bm.Get("astaxie")
bm.IsExist("astaxie")
bm.Delete("astaxie")
## memory adapter
memory adapter config like this:
## Memory adapter
Configure memory adapter like this:
{"interval":60}
interval means the gc time. The cache will
every interval time to check wheather have item expired.
interval means the gc time. The cache will
check at each time interval, whether item has expired.
## memcache adapter
memory adapter use the vitess's
[
memcache
](
code.google.com/p/vitess/go/memcache
)
client.
the config like this:
## Memcache adapter
memory adapter use the vitess's
[
Memcache
](
http://code.google.com/p/vitess/go/memcache
)
client.
Configure like this:
{"conn":"127.0.0.1:11211"}
## redis adapter
redis adapter use the
[
redigo
](
github.com/garyburd/redigo/redis
)
client.
## Redis adapter
Redis adapter use the
[
redigo
](
http://github.com/garyburd/redigo/redis
)
client.
the config
like this:
Configure
like this:
{"conn":":6039"}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment