• Stars
    star
    132
  • Rank 265,296 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

One caching API, Multiple backends

OneCache - A Go caching Library

Coverage Status Build Status

Installation

$ go get -u github.com/adelowo/onecache

Supported cache stores

  • InMemory
  • Filesystem
  • Memcached
  • Redis

OneCache 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

Examples containing all adapters can be found here

var store onecache.Store

store = 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

More Repositories

1

gulter

Golang middleware for handling multipart/form-data and uploading files
Go
50
star
2

sdump

Quickly introspect and debug webhooks/HTTP requests over SSH
Go
40
star
3

rounder

Roundtripping in Golang
Go
32
star
4

gbowo

A unified API for hippy nigerian payment processors (Currently supports Paystack and Amplifypay)
PHP
22
star
5

filer

A Golang utility for working with files
Go
16
star
6

dotfiles

Neovim + zsh + tmux
Shell
16
star
7

gottle

An HTTP ratelimiter
Go
15
star
8

muxlist

List routes in cli for Gorilla/mux
Go
15
star
9

godo

(Neo)Vim plugin to navigate todos in Go projects with ease
Vim Script
13
star
10

live-chat-widget-js

JavaScript
11
star
11

migration-demo

Go
7
star
12

react-native-web-realtime-todo

JavaScript
6
star
13

pusher-react-native-gifted-chat

Objective-C
6
star
14

jwt-revocation

Go
5
star
15

pusher-angular-realtime-feed

TypeScript
4
star
16

pusher-realtime-analytics-dashboard

Go
4
star
17

naweown

A Laravel listing web app built with TDD in mind
PHP
4
star
18

pusher-channel-terminal-web-sync

Go
4
star
19

portfolio

Personal space on the internet. Archived ( the new website is sadly closed source )
CSS
4
star
20

service-discovery-demo

Go
3
star
21

worldmap

Go
3
star
22

blogapi

Code sample for my blog post on testing handlers in Go
Go
3
star
23

dialogflow-streamchat

Java
3
star
24

gbowo-paystack

Add-ons for Gbowo's paystack adapter
PHP
2
star
25

mockdemo

Mocking the database in Golang
Go
2
star
26

address-bok

Some Sample project
PHP
2
star
27

code-samples

Code samples for my blog posts
PHP
2
star
28

fcc-leadership

Freecodecamp's Leadership board implementation with ReactJS
JavaScript
1
star
29

applesignin-streamchat

React Native Sign in with Apple example
JavaScript
1
star
30

url-shortner

Go
1
star
31

gotils

Go
1
star
32

pusher-calendar-app

Go
1
star
33

adelowo

1
star
34

pusher-app-updates-push-notifications

JavaScript
1
star
35

cfar

Controller classes for Aura.Router
PHP
1
star
36

laravel-gbowo

A laravel bridge for Gbowo
PHP
1
star
37

gbowo-app

A sample project that shows the integration of gbowo
PHP
1
star
38

consulstruct

Go
1
star
39

rails-stream-chat

Ruby
1
star
40

ruine

Go
1
star
41

twitch-streamchat

JavaScript
1
star
42

beams-pushnotifications-go

Go
1
star
43

go-crunchybridge

Go SDK for Crunchybridge ( http://crunchybridge.com )
Go
1
star
44

telescope-redis-nvim

Silly experiment to view Redis data inside Telescope right in Neovim
1
star