1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00
woodpecker/vendor/github.com/koding/cache
2016-03-07 11:23:49 -08:00
..
cache.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
doc.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
errors.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
lru_nots.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
lru.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
memory_nots.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
memory_ttl.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
memory.go Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00
README.md Added vendored dependency for github.com/koding/cache 2015-10-22 00:58:59 +02:00

Cache GoDoc Build Status

Cache is a backend provider for common use cases

Install and Usage

Install the package with:

go get github.com/koding/cache

Import it with:

import "github.com/koding/cache"

Example


// create a cache with 2 second TTL
cache := NewMemoryWithTTL(2 * time.Second)
// start garbage collection for expired keys
cache.StartGC(time.Millisecond * 10)
// set item
err := cache.Set("test_key", "test_data")
// get item
data, err := cache.Get("test_key")