lrucache

package module
v0.0.0-...-bafdd7f Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2014 License: MIT Imports: 4 Imported by: 0

README

go-lrucache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Key string
	// contains filtered or unexported fields
}

type LRUCache

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

func NewLRUCache

func NewLRUCache(capacity uint64) *LRUCache

func (*LRUCache) Clear

func (lru *LRUCache) Clear()

func (*LRUCache) Delete

func (lru *LRUCache) Delete(key string) bool

func (*LRUCache) Get

func (lru *LRUCache) Get(key string) (v Value, ok bool)

func (*LRUCache) Items

func (lru *LRUCache) Items() []Item

func (*LRUCache) Keys

func (lru *LRUCache) Keys() []string

func (*LRUCache) Set

func (lru *LRUCache) Set(key string, value Value)

func (*LRUCache) SetCapacity

func (lru *LRUCache) SetCapacity(capacity uint64)

func (*LRUCache) SetIfAbsent

func (lru *LRUCache) SetIfAbsent(key string, value Value)

func (*LRUCache) Stats

func (lru *LRUCache) Stats() (length, size, capacity uint64, oldest time.Time)

func (*LRUCache) StatsJSON

func (lru *LRUCache) StatsJSON() string

type Value

type Value interface {
	Size() int
}

Values that fgo in LRUCache need to staisfy this interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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