cache

package module
v0.0.0-...-41778ce Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 5 Imported by: 0

README

cache

Go语言的缓存库

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Has(key string) bool
	Get(key string) (interface{}, bool)
	Set(key string, v interface{}, ttl time.Duration) error
	Add(key string, v interface{}, ttl time.Duration) (bool, error)
	Remove(key string) error
	GetOrSet(key string, getter func() (interface{}, error), ttl time.Duration) (interface{}, error)
	Clear() error
}

func NewMemLRU

func NewMemLRU(size int, onEvicted func(key interface{}, value interface{})) Interface

Jump to

Keyboard shortcuts

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