inmem

package module
v0.0.0-...-12ecd81 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2016 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Documentation

Overview

Package inmem provides an in memory LRU cache with TTL support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Add(key, value interface{}, expiresAt time.Time)
	Get(key interface{}) (interface{}, bool)
	Remove(key interface{})
	Len() int
}

Cache of things.

func NewLocked

func NewLocked(size int) Cache

NewLocked constructs a new Cache of the given size that is safe for concurrent use. If will panic if size is not a positive integer.

func NewUnlocked

func NewUnlocked(size int) Cache

NewUnlocked constructs a new Cache of the given size that is not safe for concurrent use. If will panic if size is not a positive integer.

Jump to

Keyboard shortcuts

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