lwcache

package module
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2017 License: MIT Imports: 2 Imported by: 6

README

lwcache

Coverage Status CircleCI

lwcache is lightweight cache library for golang

Feature

  • simple
  • ligth weight
  • goroutine safe
  • background refresh per key
  • flexible key

Installation

go get github.com/azihsoyn/lwcache or go get gopkg.in/azihsoyn/lwcache.v1

Usage

see examples code

LICENSE

MIT

Documentation

Index

Constants

View Source
const (
	NoExpire = time.Duration(0)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key interface{}) (value interface{}, ok bool)
	Set(key interface{}, item interface{}, expire time.Duration)
	SetExpire(key interface{}, expire time.Duration)
	SetRefresher(fn func(c Cache, key interface{}, currentValue interface{}) (newValue interface{}, err error))
	StartRefresher(key interface{}, refreshInterval time.Duration)
	StopRefresher(key interface{})
}

func New

func New(name string) Cache

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL