Skip to content

emahiro/glc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Local Cache

GoDoc Go Report Card

Go Local Cache provides a simple cache mechanism for storing locally.
Go Local Cache currently only supports in-memory cache, but will also support file cache.

Installation

go get github.com/emahiro/glc

Usage

in memory cache

mc := glc.NewMemoryCache(glc.DefaultMemoryCacheExpires)

// Set
if err := mc.Set("cacheKey", []byte('hoge')); err != nil {
    log.Fatal(err)
}

// Get

data := mc.Get("cacheKey")

file cache

Usage is similar to in memory cache.
Go Local Cache creates tmp directory for file cache.

LICENSE

MIT

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages