lru

package
v0.0.0-...-1b91a60 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

package lru implements an LRU queue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LRU

type LRU struct {
	// contains filtered or unexported fields
}

LRU is an LRU queue.

func New

func New() *LRU

New creates an LRU queue.

func (*LRU) Len

func (lru *LRU) Len() int

Len returns number of keys.

func (*LRU) Pop

func (lru *LRU) Pop() interface{}

Pop pops out the least-recently-used key. It returns nil if no key exists.

func (*LRU) Remove

func (lru *LRU) Remove(key interface{})

Remove removes the provided key from LRU queue.

func (*LRU) Touch

func (lru *LRU) Touch(key interface{})

Touch marks a key as recently-used. The key will be created if not exists.

Jump to

Keyboard shortcuts

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