cache

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Simple

type Simple interface {
	Get(key string) (interface{}, bool)
	GetOrCompute(key string, creator func(key string) interface{}) (interface{}, bool)
	Put(key string, value interface{}) bool
	PutIfAbsent(key string, creator func(key string) interface{}) bool
	Has(key string) bool
	Remove(key string) bool
	Clear()
}

func New

func New() Simple

type WithExpiry

type WithExpiry interface {
	Simple
	GetOrComputeTimed(key string, lifetime time.Duration, creator func(key string) interface{}) (interface{}, bool)
	PutTimed(key string, lifetime time.Duration, value interface{}) bool
	PutTimedIfAbsent(key string, lifetime time.Duration, creator func(key string) interface{}) bool
}

func NewWithExpiry

func NewWithExpiry() WithExpiry

Jump to

Keyboard shortcuts

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