forward_lru_cache

package
v0.0.0-...-7e31768 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package lru provides an lru cache algorithm over an existing cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c httpcache.Cache, cap int) httpcache.Cache

New creates a new Cache with c as its underlying storage and a capacity of cap bytes.

Types

type Cache

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

Cache is an LRU cache. It is safe for concurrent access. It itself uses a cache for its underlying storage.

func (*Cache) Action

func (c *Cache) Action(name string, args ...interface{}) (map[string]*interface{}, error)

func (*Cache) Debug

func (c *Cache) Debug(action string)

func (*Cache) Delete

func (c *Cache) Delete(key string)

Delete removes the provided key from the cache.

func (*Cache) Get

func (c *Cache) Get(key string) (resp []byte, ok bool)

Get looks up a key's value from the cache and refreshes it.

func (*Cache) Set

func (c *Cache) Set(key string, resp []byte)

Set adds or refreshes a value in the cache.

Jump to

Keyboard shortcuts

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