Skip to content

Latest commit

 

History

History
37 lines (21 loc) · 772 Bytes

Readme.md

File metadata and controls

37 lines (21 loc) · 772 Bytes

Language: English | Русский

Go-memorycache Build Status

Manager memory key:value store/cache in Golang

How to install?

go get github.com/RGRU/go-memorycache

How to use it?

First you must import it

import (
	memorycache "github.com/RGRU/go-memorycache"
)

Init a new Cache

cache := memorycache.New("testDB", 5 * time.Minute, 10 * time.Minute)

Use it like this:

// Set cache by key
cache.Set("myKey", "My value", 5 * time.Minute)

// Get cache by key
cache.Get("myKey")

// Check exist cache
cache.Exist("myKey")

// Delete cache by key
cache.Delete("myKey")