cache

package
v0.0.0-...-f5406f0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("key not found in cache")

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(defaultExpirationInSeconds int) *Cache

func (*Cache) Use

func (this *Cache) Use(key string, expiration time.Duration, getter func() (interface{}, error), result interface{}) (err error)

func (*Cache) UseWithExpirationInResult

func (this *Cache) UseWithExpirationInResult(key string, getter func() (interface{}, time.Duration, error), result interface{}) (err error)

type Item

type Item struct {
	Key   string
	Value []byte
}

Jump to

Keyboard shortcuts

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