Skip to content

RGRU/go-memorycache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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")

Releases

No releases published

Packages

No packages published

Languages