memory

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2015 License: Apache-2.0 Imports: 1 Imported by: 1

README

#Memory

The package providers memory containers(not safe for concurrent access) storing the items in local memory (the fastest container), it's normal used for single machine or level 1 caching.

##Replacement Algorithms

  1. FIFO (first in first out)
  2. LFU (least frequently used)
  3. LRU (least recently used)
  4. MRU (most recently used)
  5. ARC (adaptive/adjustable replacement cache)

Documentation

Index

Constants

View Source
const (
	UnlimitedCapacity = 0 // unlimited capacity
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Implementation

type Implementation byte

Implementation represents a memory caching container that implemented in another package.

const (
	FIFO Implementation = iota + 1 // imports github.com/wayn3h0/go-caching/container/memory/fifo
	LFU                            // imports github.com/wayn3h0/go-caching/container/memory/lfu
	LRU                            // imports github.com/wayn3h0/go-caching/container/memory/lru
	MRU                            // imports github.com/wayn3h0/go-caching/container/memory/mru
	ARC                            // imports github.com/wayn3h0/go-caching/container/memory/arc

)

func (Implementation) Available

func (this Implementation) Available() bool

Available reports whether the given container is linked into the binary.

func (Implementation) New

func (this Implementation) New(capacity int) caching.Container

New returns a new memory container.

func (Implementation) Register

func (this Implementation) Register(function func(int) caching.Container)

Register registers the container implementation. This is intended to be called from the init function in packages that implement container functions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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