Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache []*cacheShard

func NewCache

func NewCache(maxSize int) Cache

func (*Cache) Add

func (c *Cache) Add(index uint64, obj interface{}) bool

Returns true if object already existed, false otherwise.

func (*Cache) Get

func (c *Cache) Get(index uint64) (obj interface{}, found bool)

type LRUExpireCache

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

func NewLRUExpireCache

func NewLRUExpireCache(maxSize int) *LRUExpireCache

func (*LRUExpireCache) Add

func (c *LRUExpireCache) Add(key lru.Key, value interface{}, ttl time.Duration)

func (*LRUExpireCache) Get

func (c *LRUExpireCache) Get(key lru.Key) (interface{}, bool)

Jump to

Keyboard shortcuts

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