Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adelowo/onecache
One caching API, Multiple backends
https://github.com/adelowo/onecache
cache golang
Last synced: about 2 months ago
JSON representation
One caching API, Multiple backends
- Host: GitHub
- URL: https://github.com/adelowo/onecache
- Owner: adelowo
- License: mit
- Created: 2017-04-14T21:49:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T15:44:21.000Z (about 4 years ago)
- Last Synced: 2024-01-31T05:55:31.125Z (5 months ago)
- Topics: cache, golang
- Language: Go
- Size: 109 KB
- Stars: 134
- Watchers: 8
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- Changelog: CHANGELOG.MD
- License: LICENSE
Lists
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go-extra - onecache - 04-14T21:49:15Z|2020-05-25T15:44:21Z| (Utilities / Fail injection)
- awesome-go-cn - onecache
- awesome-go-zh - onecache
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go-cn - onecache
- jimsghstars - adelowo/onecache - One caching API, Multiple backends (Go)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go-projects - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go - onecache - | - | - | (Utilities / HTTP Clients)
- awesome-go-zh - onecache
- awesome-go-with-framework - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go-stars - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go-cn - onecache
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go. - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Advanced Console UIs)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-Char - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go-cn - onecache - 支持多种后端存储的缓存库(Redis, Memcached, 文件系统等) (实用工具 / 高级控制台界面)
- awesome-go-with-stars - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- repo-1316-awesome-go-cn - onecache
- repo-1211-awesome-go-cn - onecache
- awesome-reader - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- Go-awesome - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go-cn - onecache
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Advanced Console UIs)
- awesome-go - onecache - A caching library with support for multiple backend stores (Redis, Memcached, filesystem etc) (Utilities / Advanced Console UIs)
- go-awesome-cn-star - onecache
- awesome-go - onecache - 支持多種後端存儲的緩存庫(Redis, Memcached, 文件系統等) (實用工具 / 高級控制台界面)
- awesome-go-handwritten - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). - :arrow_down:5 - :star:74 (Utilities / HTTP Clients)
- awesome-go2 - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Advanced Console UIs)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / HTTP Clients)
- awesome-go-cn - onecache
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go - onecache - Caching library with support for multiple backend stores (Redis, Memcached, filesystem etc). (Utilities / Utility/Miscellaneous)
- awesome-go - onecache - One caching API, Multiple backends - ★ 79 (Utilities)
README
### OneCache - A Go caching Library
[![Coverage Status](https://coveralls.io/repos/github/adelowo/onecache/badge.svg)](https://coveralls.io/github/adelowo/onecache)
[![Build Status](https://img.shields.io/travis/adelowo/onecache/master.svg?style=flat-square)](https://travis-ci.org/adelowo/onecache.svg?branch=master)- [Installation](#install)
- [Supported stores](#stores)
- [Examples](#eg)### Installation
```go
$ go get -u github.com/adelowo/onecache
```
Supported cache stores
- [x] InMemory
- [x] Filesystem
- [x] Memcached
- [x] RedisOneCache also comes with ___garbage collection___. This is used by the filesystem and memory adapter to purge out expired items automatically. Please refer to the [examples][eg]
[Examples containing all adapters can be found here][eg]
```go
var store onecache.Storestore = filesystem.MustNewFSStore("/home/adez/onecache_tmp")
err := store.Set("profile", []byte("Lanre"), time.Second*60)
if err != nil {
fmt.Println(err)
return
}value,err := store.Get("profile")
if err != nil {
fmt.Println(err)
return
}fmt.Println(string(value))
```Some adapters like the `filesystem` and `memory` have a ___Garbage collection___ implementation. All
that is needed to call is `store.GC()`. Ideally, this should be called in a `ticker.C`.### LICENSE
MIT[eg]: https://github.com/adelowo/onecache/blob/master/_examples/main.go