cache

package
v0.0.0-...-eb201ba Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	*lru.Cache
	// contains filtered or unexported fields
}

Manager manages the cache

func NewCache

func NewCache(maxSize int, loader func(key interface{}) (interface{}, error)) *Manager

NewCache Creates a new cache

func (*Manager) GetOrLoad

func (c *Manager) GetOrLoad(key interface{}) (interface{}, error)

GetOrLoad load the value

Jump to

Keyboard shortcuts

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