cache

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false
View Source
var ErrNotFound = errors.New("key not found in cache")
View Source
var L1Expiration = 60 // 60sec
View Source
var L1Size = 40 * 1024 * 1024 //40MB

Functions

This section is empty.

Types

type Cache

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

func NewCacheWithFallback

func NewCacheWithFallback(fallback fallback.Fallback) *Cache

func (*Cache) Get

func (this *Cache) Get(key string) (value []byte, err error)

func (*Cache) Set

func (this *Cache) Set(key string, value []byte)

func (*Cache) Use

func (this *Cache) Use(key string, getter func() (interface{}, 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