cache

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache 根据key索引的cache

func NewCache

func NewCache(timeout int64) *Cache

NewCache 生成一个lruCache,超时单位是秒

func (*Cache) Add

func (c *Cache) Add(key string, val interface{})

Add add to cache and remove expired key.

func (*Cache) Get

func (c *Cache) Get(key string) interface{}

Get get from cache and remove expired key.

Jump to

Keyboard shortcuts

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