cache

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultOnExpire

func DefaultOnExpire(d interface{})

Types

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) CheckExpirations

func (c *Cache) CheckExpirations(now time.Time)

func (*Cache) Delete

func (c *Cache) Delete(key interface{})

func (*Cache) Load

func (c *Cache) Load(key interface{}) (actual *Element)

func (*Cache) LoadOrStore

func (c *Cache) LoadOrStore(key interface{}, e *Element) (actual *Element, loaded bool)

func (*Cache) PullOutAll

func (c *Cache) PullOutAll() map[interface{}]interface{}

type Element

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

func NewElement

func NewElement(data interface{}, validUntil time.Time, onExpire func(d interface{})) *Element

func (*Element) Data

func (e *Element) Data() interface{}

func (*Element) IsExpired

func (e *Element) IsExpired(now time.Time) bool

Jump to

Keyboard shortcuts

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